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