]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 09:35:52 +0000 (11:35 +0200)
commitcca2a0a01f8193d69a021d25d23a873f03f675e7
tree2b1f9113610f8ef54fef367b0e7a6a10b5489375
parentd6d01c06ae9c59d2608bbcc8971994e651c5f9a6
Input: raspberrypi-ts - fix refcount leak in rpi_ts_probe

[ Upstream commit 5bca3688bdbc3b58a2894b8671a8e2378efe28bd ]

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: a33d78b6fe87 ("Input: add official Raspberry Pi's touchscreen driver")
Fixes: 8b732b899b84 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/input/touchscreen/raspberrypi-ts.c