linux/drivers/xen/xenbus
Dan Carpenter 970999be4c 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>
History 2022-08-25 11:45:25 +02:00
..
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xenbus.h bus: Make remove callback return void 2021-07-21 11:53:42 +02:00
xenbus_client.c xen: switch gnttab_end_foreign_access() to take a struct page pointer 2022-05-27 11:05:29 +02:00
xenbus_comms.c xen: Fix event channel callback via INTX/GSI 2021-01-13 16:12:00 +01:00
xenbus_dev_backend.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xenbus_dev_frontend.c xen/xenbus: fix return type in xenbus_file_read() 2022-08-25 11:45:25 +02:00
xenbus_probe.c xen: replace xen_remap() with memremap() 2022-06-01 07:24:17 +02:00
xenbus_probe_backend.c xenbus/xenbus_backend: Disallow pending watch messages 2020-12-14 10:08:40 +01:00
xenbus_probe_frontend.c xen: add "not_essential" flag to struct xenbus_driver 2021-11-23 13:41:29 -06:00
xenbus_xs.c xen/xenbus: Count pending messages for each watch 2020-12-14 10:07:13 +01:00