]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
power: supply: rt5033_charger: Fix device node reference leaks
authorHaotian Zhang <vulab@iscas.ac.cn>
Mon, 29 Sep 2025 11:32:34 +0000 (19:32 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 13:02:47 +0000 (14:02 +0100)
commit8c473255e5ee235e91bc5a41bbf60431a16a2db6
treea9a07fd8ee3e29edc640c8a1eb8216bcebb87e48
parentd4b3a4c2aa7b042e61303f1342ba7113783dbd09
power: supply: rt5033_charger: Fix device node reference leaks

[ Upstream commit 6cdc4d488c2f3a61174bfba4e8cc4ac92c219258 ]

The device node pointers `np_conn` and `np_edev`, obtained from
of_parse_phandle() and of_get_parent() respectively, are not released.
This results in a reference count leak.

Add of_node_put() calls after the last use of these device nodes to
properly release their references and fix the leaks.

Fixes: 8242336dc8a8 ("power: supply: rt5033_charger: Add cable detection and USB OTG supply")
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
Link: https://patch.msgid.link/20250929113234.1726-1-vulab@iscas.ac.cn
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/power/supply/rt5033_charger.c