twx-linux/drivers/input
Dmitry Torokhov ceec8ad091 Input: edt-ft5x06 - fix regmap leak when probe fails
[ Upstream commit bffdf9d7e51a7be8eeaac2ccf9e54a5fde01ff65 ]

The driver neglects to free the instance of I2C regmap constructed at
the beginning of the edt_ft5x06_ts_probe() method when probe fails.
Additionally edt_ft5x06_ts_remove() is freeing the regmap too early,
before the rest of the device resources that are managed by devm are
released.

Fix this by installing a custom devm action that will ensure that the
regmap is released at the right time during normal teardown as well as
in case of probe failure.

Note that devm_regmap_init_i2c() could not be used because the driver
may replace the original regmap with a regmap specific for M06 devices
in the middle of the probe, and using devm_regmap_init_i2c() would
result in releasing the M06 regmap too early.

Reported-by: Li Zetao <lizetao1@huawei.com>
Fixes: 9dfd9708ffba ("Input: edt-ft5x06 - convert to use regmap API")
Cc: stable@vger.kernel.org
Reviewed-by: Oliver Graute <oliver.graute@kococonnector.com>
Link: https://lore.kernel.org/r/ZxL6rIlVlgsAu-Jv@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-08 16:28:25 +01:00
..
gameport
joystick Input: xpad - add support for 8BitDo Ultimate 2C Wireless Controller 2024-11-08 16:28:16 +01:00
keyboard Input: adp5589-keys - fix adp5589_gpio_get_value() 2024-10-10 11:57:57 +02:00
misc Input: uinput - reject requests with unreasonable number of slots 2024-09-12 11:11:39 +02:00
mouse Input: synaptics - enable SMBus for HP Elitebook 840 G2 2024-09-18 19:24:05 +02:00
rmi4 Input: synaptics-rmi4 - fix UAF of IRQ domain on driver removal 2024-10-17 15:24:15 +02:00
serio Input: i8042 - add another board name for TUXEDO Stellaris Gen5 AMD line 2024-10-04 16:29:46 +02:00
tablet
tests
touchscreen Input: edt-ft5x06 - fix regmap leak when probe fails 2024-11-08 16:28:25 +01:00
apm-power.c
evbug.c
evdev.c
ff-core.c Input: ff-core - prefer struct_size over open coded arithmetic 2024-07-11 12:49:06 +02:00
ff-memless.c
input-compat.c
input-compat.h
input-core-private.h
input-leds.c
input-mt.c Input: MT - limit max slots 2024-08-29 17:33:59 +02:00
input-poller.c
input-poller.h
input.c Input: try trimming too long modalias strings 2024-06-12 11:11:18 +02:00
joydev.c
Kconfig
Makefile
matrix-keymap.c
mousedev.c
sparse-keymap.c
touchscreen.c
vivaldi-fmap.c