]> git.baikalelectronics.ru Git - kernel.git/commit
power: supply: rk817: Fix node refcount leak
authorChris Morgan <macromorgan@hotmail.com>
Wed, 20 Sep 2023 14:56:44 +0000 (09:56 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Oct 2023 12:56:49 +0000 (14:56 +0200)
commitfe6406238d5a24e9fb0286c71edd67b99d8db58d
treeaf3078aa55e3666b10e734ae8f2d03664a6ded95
parent1005010b732beff4af17e447cb965ac2204f8ce8
power: supply: rk817: Fix node refcount leak

[ Upstream commit 488ef44c068e79752dba8eda0b75f524f111a695 ]

Dan Carpenter reports that the Smatch static checker warning has found
that there is another refcount leak in the probe function. While
of_node_put() was added in one of the return paths, it should in
fact be added for ALL return paths that return an error and at driver
removal time.

Fixes: 54c03bfd094f ("power: supply: Fix refcount leak in rk817_charger_probe")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Closes: https://lore.kernel.org/linux-pm/dc0bb0f8-212d-4be7-be69-becd2a3f9a80@kili.mountain/
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Link: https://lore.kernel.org/r/20230920145644.57964-1-macroalpha82@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/power/supply/rk817_charger.c