]> 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 12:54:52 +0000 (13:54 +0100)
commit853e3e566595c04914546821e8581e4559dcf005
tree6f655f93b44eaa090b65d2a82897142bb7573ede
parent3a3dff0a73ba27c7c2e285a83ee6a8df5012f6b4
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