]> 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)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Mon, 3 Nov 2025 00:01:56 +0000 (01:01 +0100)
commit6cdc4d488c2f3a61174bfba4e8cc4ac92c219258
treee838feb8c71b0e416ba4a0f8e1d651e08ac9b261
parent1cb053ea2e1dedd8f2d9653b7c3ca5b93c8c9275
power: supply: rt5033_charger: Fix device node reference leaks

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