soc: imx: gpc: fix reference count leak in imx_gpc_remove
Subsystems (3)
PATCH 1/1 soc: imx: gpc: fix reference count leak in imx_gpc_remove
of_get_child_by_name() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak.
Fixes 721cabf6c660 ("soc: imx: move PGC handling to a new GPC driver")
Signed-off-by Miaoqian Lin <[email protected]>
--- drivers/pmdomain/imx/gpc.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/pmdomain/imx/gpc.c +2 -0
@@ -536,6 +536,8 @@ static void imx_gpc_remove(struct platform_device *pdev)return ; } } + +of_node_put (pgc_node); }static struct platform_driver imx_gpc_driver = {
Signature · 1 line
2.39.5 (Apple Git-154)
Quoted 8 lines · Miaoqian Lin
of_get_child_by_name()returns a node pointer with refcount incremented, we should useof_node_put()on it when not need anymore. Add missingof_node_put()to avoid refcount leak.Fixes 721cabf6c660 ("soc: imx: move PGC handling to a new GPC driver")Signed-off-by Miaoqian Lin <[email protected]>
Applied for fixes, thanks!
Kind regards
Uffe
Quoted 20 lines
--- drivers/pmdomain/imx/gpc.c | 2 ++ 1 file changed, 2 insertions(+)drivers/pmdomain/imx/gpc.c +2
-1@@ -536,6 +536,8 @@ static void imx_gpc_remove(struct platform_device *pdev)return ; } } + +of_node_put (pgc_node); }static struct platform_driver imx_gpc_driver = { --2.39.5 (Apple Git-154)