WSL2-Linux-Kernel/drivers/usb/misc
Mattias Jacobsson 090158555f USB: misc: appledisplay: fix backlight update_status return code
Upon success the update_status handler returns a positive number
corresponding to the number of bytes transferred by usb_control_msg.
However the return code of the update_status handler should indicate if
an error occurred(negative) or how many bytes of the user's input to sysfs
that was consumed. Return code zero indicates all bytes were consumed.

The bug can for example result in the update_status handler being called
twice, the second time with only the "unconsumed" part of the user's input
to sysfs. Effectively setting an incorrect brightness.

Change the update_status handler to return zero for all successful
transactions and forward usb_control_msg's error code upon failure.

Signed-off-by: Mattias Jacobsson <2pi@mok.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-18 19:44:39 +02:00
..
sisusbvga usb-misc: sisusbvga: remove redundant variable modey 2018-07-13 15:41:56 +02:00
Kconfig
Makefile
adutux.c usb: adutux: use irqsave() in USB's complete callback 2018-06-28 19:36:06 +09:00
appledisplay.c USB: misc: appledisplay: fix backlight update_status return code 2018-10-18 19:44:39 +02:00
chaoskey.c
cypress_cy7c63.c
cytherm.c
ehset.c
emi26.c
emi62.c
ezusb.c
ftdi-elan.c
idmouse.c
iowarrior.c usb: iowarrior: replace kmalloc with kmalloc_array 2018-09-10 20:05:28 +02:00
isight_firmware.c
ldusb.c usb: ldusb: use irqsave() in USB's complete callback 2018-06-28 19:36:06 +09:00
legousbtower.c usb: legousbtower: use irqsave() in USB's complete callback 2018-06-28 19:36:07 +09:00
lvstest.c
rio500.c
rio500_usb.h
trancevibrator.c usb: misc: fix obsolete function 2018-09-10 20:06:48 +02:00
usb251xb.c
usb3503.c
usb4604.c
usb_u132.h
usblcd.c
usbsevseg.c
usbtest.c usb: usbtest: use irqsave() in USB's complete callback 2018-07-06 16:36:19 +02:00
uss720.c usb: misc: uss720: Fix two sleep-in-atomic-context bugs 2018-09-05 14:36:53 +02:00
yurex.c USB: yurex: Check for truncation in yurex_read() 2018-09-05 13:27:06 +02:00