Skip to contentSkip to conversation

soc: rockchip: grf: Fix device node reference leak in rockchip_grf_init()

PATCH In review Felix Gu 2 participants 2 messages Feb 16 – Feb 21 Arm Rockchip

lore
Share & tools
lore

Felix Gu

author
#0 lore raw

PATCH 1/1 soc: rockchip: grf: Fix device node reference leak in rockchip_grf_init()

In rockchip_grf_init(), when syscon_node_to_regmap fails, it returns without calling of_node_put(), which causes a reference leak.

Add the missing of_node_put() call to fix it.

Fixes 75fb63ae0312 ("soc: rockchip: grf: Support multiple grf to be handled")
---
 drivers/soc/rockchip/grf.c | 1 +
 1 file changed, 1 insertion(+)
drivers/soc/rockchip/grf.c +1 -0
index 04937c40da47..b459607c118a 100644
@@ -231,6 +231,7 @@ static int __init rockchip_grf_init(void)
 		grf = syscon_node_to_regmap(np);
 		if (IS_ERR(grf)) {
 			pr_err("%s: could not get grf syscon\n", __func__);
+			of_node_put(np);
 			return PTR_ERR(grf);
 		}
 

---
base-commit: 350adaf7fde9fdbd9aeed6d442a9ae90c6a3ab97
change-id: 20260217-grf-fc76046fe5e3

Best regards,

Signature · 1 line
Felix Gu <[email protected]>
maintainer
#1 lore raw

Hi Felix,

Am Montag, 16. Februar 2026, 21:11:32 Mitteleuropäische Normalzeit schrieb Felix Gu:

Quoted 7 lines

In rockchip_grf_init(), when syscon_node_to_regmap fails, it returns without calling of_node_put(), which causes a reference leak.

Add the missing of_node_put() call to fix it.

Fixes 75fb63ae0312 ("soc: rockchip: grf: Support multiple grf to be handled")

Shawn was a bit earlier with a similar fix [0], so their patch will go in.

Heiko

[0] https://lore.kernel.org/all/[email protected]/