OpenCloudOS-Kernel/drivers/usb/gadget/legacy
Dan Carpenter 3343f376d4 usb: gadget: prevent a ternary sign expansion bug
The problem is that "req->actual" is a u32, "req->status" is an int, and
iocb->ki_complete() takes a long.  We would expect that a negative error
code in "req->status" would translate to a negative long value.

But what actually happens is that because "req->actual" is a u32, the
error codes is type promoted to a high positive value and then remains
a positive value when it is cast to long.  (No sign expansion).

We can fix this by casting "req->status" to long.

Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YIE7RrBPLWc3XtMg@mwanda
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-22 13:17:29 +02:00
..
Kconfig usb: raw-gadget: update documentation and Kconfig 2021-01-26 18:38:45 +01:00
Makefile usb: gadget: add raw-gadget interface 2020-03-15 11:34:48 +02:00
acm_ms.c USB: gadget: legacy: fix return error code in acm_ms_bind() 2020-12-28 15:45:50 +01:00
audio.c usb: gadget: audio: Fix a missing error return value in audio_bind() 2020-05-09 11:05:02 +03:00
cdc2.c usb: gadget: legacy: fix error return code in cdc_bind() 2020-05-09 11:05:08 +03:00
dbgp.c USB: add SPDX identifiers to all remaining files in drivers/usb/ 2017-11-04 11:48:02 +01:00
ether.c USB: gadget: legacy: fix an error code in eth_bind() 2021-01-31 13:53:39 +01:00
g_ffs.c usb: gadget: legacy: set max_speed to super-speed 2020-01-15 10:39:21 +01:00
gmidi.c usb: gadget: legacy: gmidi: remove useless cast for driver.name 2020-02-19 11:10:24 +01:00
hid.c USB: gadget: legacy: Remove redundant license text 2017-11-07 15:45:02 +01:00
inode.c usb: gadget: prevent a ternary sign expansion bug 2021-04-22 13:17:29 +02:00
mass_storage.c usb: gadget: legacy: fix error return code of msg_bind() 2021-03-23 14:13:29 +01:00
multi.c USB: gadget: legacy: remove left-over __ref annotations 2021-03-23 12:57:10 +01:00
ncm.c usb: gadget: legacy: fix error return code in gncm_bind() 2020-05-09 11:05:08 +03:00
nokia.c usb: gadget: legacy: nokia: Remove unused static variable 'product_nokia' 2020-07-09 17:19:56 +02:00
printer.c usb: gadget: legacy: printer: Remove unused variable 'driver_desc' 2020-07-09 17:19:56 +02:00
raw_gadget.c usb: raw-gadget: add copyright 2021-01-26 18:38:45 +01:00
serial.c usb: gadget: legacy/serial: allow dynamic removal 2019-10-22 10:27:15 +03:00
tcm_usb_gadget.c usb: gadget: tcm: fix spelling mistake: "Manufactor" -> "Manufacturer" 2018-07-26 13:35:29 +03:00
webcam.c usb: webcam: Invalid size of Processing Unit Descriptor 2021-03-18 09:02:27 +01:00
zero.c USB: Fix up terminology 2020-07-01 14:04:04 +02:00