soc: rockchip: grf: Fix device node reference leak in rockchip_grf_init()
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")
Signed-off-by Felix Gu <[email protected]>
--- drivers/soc/rockchip/grf.c | 1 + 1 file changed, 1 insertion(+)
drivers/soc/rockchip/grf.c +1 -0
@@ -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]>
Heiko Stübner
maintainerHi Felix,
Am Montag, 16. Februar 2026, 21:11:32 Mitteleuropäische Normalzeit schrieb Felix Gu:
Quoted 7 lines
In
rockchip_grf_init(), whensyscon_node_to_regmapfails, it returns without callingof_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")Signed-off-by Felix Gu <[email protected]>
Shawn was a bit earlier with a similar fix [0], so their patch will go in.
Heiko