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)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Sat, 3 Dec 2022 01:03:24 +0000 (02:03 +0100)
commit54c03bfd094fb74f9533a9c28250219afe182382
treed685168642b586563a3f255a0d1b8075a83ca678
parent571650b3a30f67d70df242508631ed5e7de2c2df
power: supply: Fix refcount leak in rk817_charger_probe

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>
drivers/power/supply/rk817_charger.c