Input: raspberrypi-ts - fix refcount leak in rpi_ts_probe
authorMiaoqian Lin <linmq006@gmail.com>
Fri, 14 Apr 2023 06:05:20 +0000 (23:05 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 14 Apr 2023 06:08:11 +0000 (23:08 -0700)
commit5bca3688bdbc3b58a2894b8671a8e2378efe28bd
tree448777c8d789e88cad6d8dde6feee5c8aae05c1c
parent483a14418661878d89216be0f02918892227833b
Input: raspberrypi-ts - fix refcount leak in rpi_ts_probe

rpi_firmware_get() take reference, we need to release it in error paths
as well. Use devm_rpi_firmware_get() helper to handling the resources.
Also remove the existing rpi_firmware_put().

Fixes: 0b9f28fed3f7 ("Input: add official Raspberry Pi's touchscreen driver")
Fixes: 3b8ddff780b7 ("input: raspberrypi-ts: Release firmware handle when not needed")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20221223074657.810346-1-linmq006@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/touchscreen/raspberrypi-ts.c