android_kernel_xiaomi_sm7250/drivers/xen/xenbus
Dan Carpenter 56d9d71cfe xen/xenbus: fix return type in xenbus_file_read()
commit 32ad11127b95236dfc52375f3707853194a7f4b4 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:15:39 +02:00
..
Makefile
xenbus_client.c xen/xenbus: don't let xenbus_grant_ring() remove grants in error case 2022-03-11 10:15:12 +01:00
xenbus_comms.c xen: Fix event channel callback via INTX/GSI 2021-01-27 11:05:37 +01:00
xenbus_dev_backend.c
xenbus_dev_frontend.c xen/xenbus: fix return type in xenbus_file_read() 2022-08-25 11:15:39 +02:00
xenbus_probe_backend.c xenbus/xenbus_backend: Disallow pending watch messages 2020-12-30 11:26:17 +01:00
xenbus_probe_frontend.c
xenbus_probe.c xen: detect uninitialized xenbus in xenbus_init 2021-12-01 09:27:39 +01:00
xenbus_xs.c xen/xenbus: Count pending messages for each watch 2020-12-30 11:26:17 +01:00
xenbus.h arm/xen: Don't probe xenbus as part of an early initcall 2021-02-23 15:00:56 +01:00