power: supply: Fix refcount leak in rk817_charger_probe
authorQiheng Lin <linqiheng@huawei.com>
Mon, 28 Nov 2022 14:27:40 +0000 (22:27 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:45 +0000 (13:32 +0100)
commit7d1e3961725e69774871b081a065c2b3640c5f0e
treec8fbca118e07c2d6cc7b19ea59e5a31724a2c8bd
parentb866e8a0b7dc28d7f1b1c4f7d1329b6f0ff5c77d
power: supply: Fix refcount leak in rk817_charger_probe

[ Upstream commit 54c03bfd094fb74f9533a9c28250219afe182382 ]

of_get_child_by_name() returns a node pointer with refcount
incremented, we should use of_node_put() on it when not need anymore.
Add missing of_node_put() to avoid refcount leak.

Fixes: 11cb8da0189b ("power: supply: Add charger driver for Rockchip RK817")
Signed-off-by: Qiheng Lin <linqiheng@huawei.com>
Reviewed-by: Chris Morgan <macromorgan@hotmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/power/supply/rk817_charger.c