WSL2-Linux-Kernel/drivers/xen/xenbus
Dan Carpenter 75b810104e xen/xenbus: fix return type in xenbus_file_read()
commit 32ad11127b upstream.

This code tries to store -EFAULT in an unsigned int.  The
xenbus_file_read() function returns type ssize_t so the negative value
is returned as a positive value to the user.

This change forces another change to the min() macro.  Originally, the
min() macro used "unsigned" type which checkpatch complains about.  Also
unsigned type would break if "len" were not capped at MAX_RW_COUNT.  Use
size_t for the min().  (No effect on runtime for the min_t() change).

Fixes: 2fb3683e7b ("xen: Add xenbus device driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Link: https://lore.kernel.org/r/YutxJUaUYRG/VLVc@kili
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-25 11:40:14 +02:00
..
Makefile
xenbus.h bus: Make remove callback return void 2021-07-21 11:53:42 +02:00
xenbus_client.c xen/xenbus: don't let xenbus_grant_ring() remove grants in error case 2022-03-11 12:22:36 +01:00
xenbus_comms.c xen: Fix event channel callback via INTX/GSI 2021-01-13 16:12:00 +01:00
xenbus_dev_backend.c
xenbus_dev_frontend.c xen/xenbus: fix return type in xenbus_file_read() 2022-08-25 11:40:14 +02:00
xenbus_probe.c xen: detect uninitialized xenbus in xenbus_init 2021-12-01 09:04:42 +01:00
xenbus_probe_backend.c xenbus/xenbus_backend: Disallow pending watch messages 2020-12-14 10:08:40 +01:00
xenbus_probe_frontend.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
xenbus_xs.c xen/xenbus: Count pending messages for each watch 2020-12-14 10:07:13 +01:00