From e45dfc5368376aa06936adb23ddebfbb4aeea352 Mon Sep 17 00:00:00 2001 From: Miaoqian Lin Date: Fri, 21 Nov 2025 12:15:53 -0500 Subject: [PATCH] pmdomain: imx: Fix reference count leak in imx_gpc_remove [ Upstream commit bbde14682eba21d86f5f3d6fe2d371b1f97f1e61 ] of_get_child_by_name() returns a node pointer with refcount incremented, we should use of_node_put() on it when not needed anymore. Add the missing of_node_put() to avoid refcount leak. Fixes: 721cabf6c660 ("soc: imx: move PGC handling to a new GPC driver") Cc: stable@vger.kernel.org Signed-off-by: Miaoqian Lin Signed-off-by: Ulf Hansson [ drivers/pmdomain/imx/gpc.c -> drivers/soc/imx/gpc.c ] Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/soc/imx/gpc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/soc/imx/gpc.c b/drivers/soc/imx/gpc.c index 90a8b2c0676ff..8d0d05041be3f 100644 --- a/drivers/soc/imx/gpc.c +++ b/drivers/soc/imx/gpc.c @@ -540,6 +540,8 @@ static int imx_gpc_remove(struct platform_device *pdev) return ret; } + of_node_put(pgc_node); + return 0; } -- 2.47.3