mirror-linux/drivers/input/mouse
Josh Poimboeuf 7501153750 objtool, Input: cyapa - Remove undefined behavior in cyapa_update_fw_store()
In cyapa_update_fw_store(), if 'count' is zero, the write to
fw_name[count-1] underflows the array.

Presumably that's not possible in normal operation, as its caller
sysfs_kf_write() already checks for zero.  Regardless it's a good idea
to check for the error explicitly and avoid undefined behavior.

Fixes the following warning with an UBSAN kernel:

  vmlinux.o: warning: objtool: .text.cyapa_update_fw_store: unexpected end of section

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/73ae0bb3c656735890d914b74c9d6bb40c25d3cd.1742852847.git.jpoimboe@kernel.org
Closes: https://lore.kernel.org/oe-kbuild-all/202503171547.LlCTJLQL-lkp@intel.com/
2025-03-25 23:00:15 +01:00
..
Kconfig Revert "Input: Add driver for PixArt PS/2 touchpad" 2024-10-01 03:54:05 -07:00
Makefile Revert "Input: Add driver for PixArt PS/2 touchpad" 2024-10-01 03:54:05 -07:00
alps.c Input: alps - use guard notation when pausing serio port 2024-10-04 00:58:15 -07:00
alps.h
amimouse.c Input: switch back to struct platform_driver::remove() 2024-10-15 11:43:25 -07:00
appletouch.c Input: mouse - use sizeof(*pointer) instead of sizeof(type) 2024-06-02 21:32:02 -07:00
atarimouse.c
bcm5974.c Input: bcm5974 - use guard notation when acquiring mutex 2024-08-29 11:00:21 -07:00
byd.c Input: byd - use guard notation when pausing serio port 2024-10-04 00:58:15 -07:00
byd.h
cyapa.c objtool, Input: cyapa - Remove undefined behavior in cyapa_update_fw_store() 2025-03-25 23:00:15 +01:00
cyapa.h
cyapa_gen3.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
cyapa_gen5.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
cyapa_gen6.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
cypress_ps2.c Input: cypress_ps2 - fix waiting for command response 2024-08-29 10:46:17 -07:00
cypress_ps2.h Input: cypress_ps2 - fix error handling when sending command fails 2024-07-03 13:48:53 -07:00
elan_i2c.h
elan_i2c_core.c Input: Use str_enable_disable-like helpers 2025-01-14 13:41:41 -08:00
elan_i2c_i2c.c Input updates for v6.13-rc0 2024-11-25 10:31:39 -08:00
elan_i2c_smbus.c
elantech.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
elantech.h
focaltech.c Input: mouse - use sizeof(*pointer) instead of sizeof(type) 2024-06-02 21:32:02 -07:00
focaltech.h
gpio_mouse.c
hgpk.c Input: mouse - use sizeof(*pointer) instead of sizeof(type) 2024-06-02 21:32:02 -07:00
hgpk.h
inport.c
lifebook.c Input: mouse - use sizeof(*pointer) instead of sizeof(type) 2024-06-02 21:32:02 -07:00
lifebook.h
logibm.c
logips2pp.c
logips2pp.h
maplemouse.c Input: mouse - use sizeof(*pointer) instead of sizeof(type) 2024-06-02 21:32:02 -07:00
pc110pad.c
psmouse-base.c Revert "Input: Add driver for PixArt PS/2 touchpad" 2024-10-01 03:54:05 -07:00
psmouse-smbus.c Input: psmouse-smbus - use guard notation when acquiring mutex 2024-10-03 08:39:21 -07:00
psmouse.h Revert "Input: Add driver for PixArt PS/2 touchpad" 2024-10-01 03:54:05 -07:00
rpcmouse.c
sentelic.c Input: mouse - use sizeof(*pointer) instead of sizeof(type) 2024-06-02 21:32:02 -07:00
sentelic.h
sermouse.c Input: mouse - use sizeof(*pointer) instead of sizeof(type) 2024-06-02 21:32:02 -07:00
synaptics.c Input: synaptics - fix crash when enabling pass-through port 2025-01-20 21:27:02 -08:00
synaptics.h Input: synaptics - fix crash when enabling pass-through port 2025-01-20 21:27:02 -08:00
synaptics_i2c.c Input: mouse - use sizeof(*pointer) instead of sizeof(type) 2024-06-02 21:32:02 -07:00
synaptics_usb.c
touchkit_ps2.c
touchkit_ps2.h
trackpoint.c Input: libps2 - attach ps2dev instances as serio port's drvdata 2023-05-18 11:40:32 -07:00
trackpoint.h
vmmouse.c input/vmmouse: Use VMware hypercall API 2024-06-25 17:15:47 +02:00
vmmouse.h
vsxxxaa.c Input: mouse - use sizeof(*pointer) instead of sizeof(type) 2024-06-02 21:32:02 -07:00