android_kernel_motorola_sm6375/drivers/usb
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Dan Carpenter 644b956c94 usb: fotg210-hcd: delete an incorrect bounds test
[ Upstream commit 7fbcd195e2b8cc952e4aeaeb50867b798040314c ]

Here "temp" is the number of characters that we have written and "size"
is the size of the buffer.  The intent was clearly to say that if we have
written to the end of the buffer then stop.

However, for that to work the comparison should have been done on the
original "size" value instead of the "size -= temp" value.  Not only
will that not trigger when we want to, but there is a small chance that
it will trigger incorrectly before we want it to and we break from the
loop slightly earlier than intended.

This code was recently changed from using snprintf() to scnprintf().  With
snprintf() we likely would have continued looping and passed a negative
size parameter to snprintf().  This would have triggered an annoying
WARN().  Now that we have converted to scnprintf() "size" will never
drop below 1 and there is no real need for this test.  We could change
the condition to "if (temp <= 1) goto done;" but just deleting the test
is cleanest.

Fixes: 7d50195f6c ("usb: host: Faraday fotg210-hcd driver")
Cc: stable <[email protected]>
Signed-off-by: Dan Carpenter <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Reviewed-by: Lee Jones <[email protected]>
Link: https://lore.kernel.org/r/ZXmwIwHe35wGfgzu@suswa
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2024-01-08 11:29:47 +01:00
..
atm
c67x00
cdns3 usb: cdns3: Fix issue with using incorrect PCI device function 2023-04-05 11:16:40 +02:00
chipidea usb: chipidea: imx: don't request QoS for imx8ulp 2023-08-30 16:27:10 +02:00
class USB: usbtmc: Fix direction for 0-length ioctl control messages 2023-05-30 12:44:06 +01:00
common usb: common: usb-conn-gpio: Prevent bailing out if initial role is none 2023-08-16 18:19:23 +02:00
core usb: hub: Guard against accesses to uninitialized BOS descriptors 2023-10-25 11:53:20 +02:00
dwc2 USB: dwc2: write HCINT with INTMASK applied 2023-12-08 08:44:25 +01:00
dwc3 USB: dwc3: qcom: fix wakeup after probe deferral 2023-12-08 08:44:25 +01:00
early
gadget usb: gadget: f_hid: fix report descriptor allocation 2023-12-13 18:18:15 +01:00
host usb: fotg210-hcd: delete an incorrect bounds test 2024-01-08 11:29:47 +01:00
image
isp1760
misc USB: sisusbvga: Add endpoint checks 2023-05-30 12:44:10 +01:00
mon
mtu3 usb: mtu3: fix kernel panic at qmu transfer done irq handler 2023-05-17 11:35:49 +02:00
musb usb: musb: Modify the "HWVers" register address 2023-10-25 11:53:19 +02:00
phy usb: phy: mxs: fix getting wrong state with mxs_phy_is_otg_host() 2023-09-23 10:59:49 +02:00
renesas_usbhs
roles
serial USB: serial: option: add Quectel RM500Q R13 firmware support 2024-01-08 11:29:47 +01:00
storage usb: storage: set 1.50 as the lower bcdDevice for older "Super Top" compatibility 2023-11-08 11:23:42 +01:00
typec usb: typec: class: fix typec_altmode_put_partner to put plugs 2023-12-13 18:18:16 +01:00
usbip USB: usbip: fix stub_dev hub disconnect 2023-11-20 10:30:14 +01:00
Kconfig
Makefile
usb-skeleton.c