android_kernel_motorola_sm6225/drivers
Dan Carpenter cab15e2e70 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 <stable@kernel.org>
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/ZXmwIwHe35wGfgzu@suswa
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-01-08 11:27:37 +01:00
..
accessibility
acpi ACPI: sysfs: Fix create_pnp_modalias() and create_of_modalias() 2023-11-20 10:29:17 +01:00
amba amba: bus: fix refcount leak 2023-09-23 10:48:09 +02:00
android binder: fix memory leak in binder_init() 2023-08-16 18:13:00 +02:00
ata ata: pata_isapnp: Add missing error check for devm_ioport_map() 2023-12-08 08:43:23 +01:00
atm atm: solos-pci: Fix potential deadlock on &tx_queue_lock 2023-12-20 15:38:00 +01:00
auxdisplay
base devcoredump: Send uevent once devcd is ready 2023-12-13 17:42:21 +01:00
bcma
block remove the sx8 block driver 2023-11-08 11:22:21 +01:00
bluetooth Bluetooth: vhci: Fix race when opening vhci device 2023-10-25 11:16:40 +02:00
bus bus: imx-weim: fix branch condition evaluates to a garbage value 2023-04-05 11:15:38 +02:00
cdrom
char hwrng: geode - fix accessing registers 2023-11-20 10:29:18 +01:00
clk clk: qcom: ipq8074: drop the CLK_SET_RATE_PARENT flag from PLL clocks 2023-11-28 16:46:34 +00:00
clocksource clocksource/drivers/timer-atmel-tcb: Fix initialization on SAM9 hardware 2023-11-28 16:46:31 +00:00
connector
cpufreq cpufreq: imx6q: Don't disable 792 Mhz OPP unnecessarily 2023-12-08 08:43:26 +01:00
cpuidle sched,idle,rcu: Push rcu_idle deeper into the idle path 2023-10-25 11:16:26 +02:00
crypto chtls: fix tp->rcv_tstamp initialization 2023-11-20 10:29:17 +01:00
dax
dca
devfreq PM / devfreq: Fix leak in devfreq_dev_release() 2023-09-23 10:48:10 +02:00
dio drivers: dio: fix possible memory leak in dio_init() 2023-01-18 11:30:23 +01:00
dma dmaengine: stm32-mdma: correct desc prep when channel running 2023-11-28 16:46:35 +00:00
dma-buf dma-buf/sw_sync: Avoid recursive lock during fence signal 2023-08-30 16:31:56 +02:00
edac EDAC/skx: Fix overflows on the DRAM row address mapping arrays 2023-05-17 11:13:09 +02:00
eisa
extcon extcon: Fix kernel doc of property capability fields to avoid warnings 2023-08-11 11:45:12 +02:00
firewire firewire: core: fix possible memory leak in create_units() 2023-12-08 08:43:25 +01:00
firmware firmware: ti_sci: Mark driver as non removable 2023-11-20 10:29:18 +01:00
fmc
fpga fpga: bridge: fix kernel-doc parameter description 2023-05-17 11:13:15 +02:00
fsi fsi: master-ast-cf: Add MODULE_FIRMWARE macro 2023-09-23 10:47:57 +02:00
gnss
gpio gpiolib: sysfs: Fix error handling on failed export 2023-12-13 17:42:19 +01:00
gpu drm/amdgpu: correct chunk_ptr to a pointer to chunk. 2023-12-13 17:42:16 +01:00
hid HID: hid-asus: add const to read-only outgoing usb buffer 2023-12-20 15:38:03 +01:00
hsi HSI: omap_ssi_core: Fix error handling in ssi_init() 2023-01-18 11:30:30 +01:00
hv Drivers: hv: vmbus: Fix vmbus_wait_for_unload() to scan present CPUs 2023-06-28 10:15:28 +02:00
hwmon hwmon: (acpi_power_meter) Fix 4.29 MW bug 2023-12-13 17:42:17 +01:00
hwspinlock
hwtracing coresight: Fix signedness bug in tmc_etr_buf_insert_barrier_packet() 2023-05-30 12:42:15 +01:00
i2c i2c: i801: fix potential race in i801_block_transaction_byte_by_byte 2023-11-28 16:46:35 +00:00
ide treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
idle intel_idle: Disable IBRS during long idle 2022-11-23 07:53:45 +01:00
iio iio: common: ms_sensors: ms_sensors_i2c: fix humidity conversion time table 2024-01-08 11:27:35 +01:00
infiniband IB/isert: Fix unaligned immediate-data handling 2023-12-13 17:42:20 +01:00
input Input: ipaq-micro-keys - add error handling for devm_kmemdup 2024-01-08 11:27:35 +01:00
iommu iommu/mediatek-v1: Fix an error handling path in mtk_iommu_v1_probe() 2023-01-18 11:30:55 +01:00
ipack
irqchip irqchip/stm32-exti: add missing DT IRQ flag translation 2023-11-08 11:22:19 +01:00
isdn mISDN: Update parameter type of dsp_cmx_send() 2023-08-16 18:13:00 +02:00
leds leds: trigger: ledtrig-cpu:: Fix 'output may be truncated' issue for 'cpu' 2023-11-20 10:29:19 +01:00
lightnvm
macintosh macintosh: via-pmu-led: requires ATA to be set 2023-05-17 11:13:18 +02:00
mailbox mailbox: ti-msgmgr: Fill non-message tx data fields with 0x0 2023-08-11 11:45:13 +02:00
mcb mcb: fix error handling for different scenarios when parsing 2023-11-28 16:46:35 +00:00
md bcache: avoid NULL checking to c->root in run_cache_set() 2023-12-20 15:38:02 +01:00
media media: davinci: vpif_capture: fix potential double free 2023-12-13 17:42:15 +01:00
memory memory: of: Fix refcount leak bug in of_get_ddr_timings() 2022-10-26 13:19:28 +02:00
memstick memstick r592: make memstick_debug_get_tpc_name() static 2023-08-11 11:45:06 +02:00
message scsi: message: mptlan: Fix use after free bug in mptlan_remove() due to race condition 2023-05-30 12:42:09 +01:00
mfd mfd: dln2: Fix double put in dln2_probe 2023-11-20 10:29:19 +01:00
misc misc: st_core: Do not call kfree_skb() under spin_lock_irqsave() 2023-11-20 10:29:20 +01:00
mmc mmc: block: Be sure to wait while busy in CQE error recovery 2023-12-20 15:38:04 +01:00
mtd mtd: cfi_cmdset_0001: Byte swap OTP info 2023-12-08 08:43:26 +01:00
mux
net ethernet: atheros: fix a memleak in atl1e_setup_ring_resources 2024-01-08 11:27:34 +01:00
nfc nfcsim.c: Fix error checking for debugfs_create_dir 2023-06-28 10:15:31 +02:00
ntb ntb: Fix calculation ntb_transport_tx_free_entry() 2023-09-23 10:48:10 +02:00
nubus
nvdimm nd_btt: Make BTT lanes preemptible 2023-11-20 10:29:18 +01:00
nvme nvme-pci: do not set the NUMA node of device if it has none 2023-10-10 21:44:59 +02:00
nvmem nvmem: imx: correct nregs for i.MX6UL 2023-11-08 11:22:16 +01:00
of of: unittest: Fix overlay type in apply/revert check 2023-09-23 10:48:04 +02:00
opp
oprofile
parisc parisc: iosapic.c: Fix sparse warnings 2023-10-10 21:44:58 +02:00
parport parport: Add support for Brainboxes IX/UC/PX parallel cards 2023-12-13 17:42:19 +01:00
pci Revert "PCI: acpiphp: Reassign resources on bridge if necessary" 2023-12-20 15:38:01 +01:00
pcmcia pcmcia: ds: fix possible name leak in error path in pcmcia_device_add() 2023-11-20 10:29:20 +01:00
perf perf: arm_dsu: Fix hotplug callback leak in dsu_pmu_init() 2023-01-18 11:30:02 +01:00
phy phy: mapphone-mdm6600: Fix runtime PM for remove 2023-10-25 11:17:02 +02:00
pinctrl pinctrl: at91-pio4: use dedicated lock class for IRQ 2024-01-08 11:27:34 +01:00
platform platform/x86: intel_telemetry: Fix kernel doc descriptions 2023-12-20 15:38:02 +01:00
pnp PNP: fix name memory leak in pnp_alloc_dev() 2023-01-18 11:30:05 +01:00
power power: supply: Fix logic checking if system is running from battery 2023-06-21 15:39:56 +02:00
powercap powercap: fix possible name leak in powercap_register_zone() 2023-03-11 16:31:36 +01:00
pps
ps3
ptp ptp: annotate data-race around q->head and q->tail 2023-11-28 16:46:33 +00:00
pwm pwm: brcmstb: Utilize appropriate clock APIs in suspend/resume 2023-11-20 10:29:20 +01:00
rapidio rapidio: devices: fix missing put_device in mport_cdev_open 2023-01-18 11:30:08 +01:00
ras
regulator regulator: Fix error checking for debugfs_create_dir 2023-06-21 15:39:56 +02:00
remoteproc remoteproc: qcom: wcnss: Fix handling of IRQs 2022-08-25 11:15:21 +02:00
reset reset: Fix crash when freeing non-existent optional resets 2024-01-08 11:27:33 +01:00
rpmsg rpmsg: Fix possible refcount leak in rpmsg_register_device_override() 2023-11-08 11:22:19 +01:00
rtc rtc: ds1685: use EXPORT_SYMBOL_GPL for ds1685_rtc_poweroff 2023-09-23 10:47:56 +02:00
s390 s390/dasd: protect device queue against concurrent access 2023-12-08 08:43:24 +01:00
sbus
scsi scsi: bnx2fc: Fix skb double free in bnx2fc_rcv() 2024-01-08 11:27:35 +01:00
sfi
sh
siox siox: fix possible memory leak in siox_device_add() 2022-11-25 17:40:23 +01:00
slimbus slimbus: stream: correct presence rate frequencies 2022-11-25 17:40:25 +01:00
sn
soc soc: qcom: qmi_encdec: Restrict string length in decode 2023-09-23 10:48:12 +02:00
soundwire soundwire: bus_type: fix remove and shutdown support 2022-08-25 11:15:15 +02:00
spi spi: imx: mx51-ecspi: Move some initialisation to prepare_message hook. 2023-12-13 17:42:15 +01:00
spmi spmi: Add a check for remove callback when removing a SPMI driver 2023-05-17 11:13:17 +02:00
ssb treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
staging erofs: ensure that the post-EOF tails are all zeroed 2023-09-23 10:47:56 +02:00
target scsi: target: core: Fix deadlock due to recursive locking 2023-10-10 21:45:01 +02:00
tc
tee tee: add overflow check in register_shm_helper() 2022-08-25 11:15:48 +02:00
thermal thermal: core: prevent potential string overflow 2023-11-20 10:29:17 +01:00
thunderbolt thunderbolt: Use const qualifier for ring_interrupt_index 2023-04-05 11:15:35 +02:00
tty serial: 8250_omap: Add earlycon support for the AM654 UART controller 2023-12-13 17:42:19 +01:00
uio uio: uio_dmem_genirq: Fix deadlock between irq config and handling 2023-01-18 11:30:25 +01:00
usb usb: fotg210-hcd: delete an incorrect bounds test 2024-01-08 11:27:37 +01:00
uwb
vfio vfio: platform: Do not pass return buffer to ACPI _RST method 2023-01-18 11:30:25 +01:00
vhost treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
video fbdev: stifb: Make the STI next font pointer a 32-bit signed offset 2023-12-08 08:43:26 +01:00
virt vboxguest: Do not use devm for irq 2022-08-25 11:15:43 +02:00
virtio virtio-mmio: fix memory leak of vm_dev 2023-11-08 11:22:15 +01:00
visorbus
vlynq
vme vme: Fix error not catched in fake_init() 2023-01-18 11:30:28 +01:00
w1 w1: fix loop in w1_fini() 2023-08-11 11:45:11 +02:00
watchdog watchdog: iTCO_wdt: Set NO_REBOOT if the watchdog is not already running 2023-10-10 21:44:59 +02:00
xen xen/events: fix delayed eoi list handling 2023-11-28 16:46:33 +00:00
zorro
Kconfig
Makefile