]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
pmdomain: imx: Fix reference count leak in imx_gpc_remove
authorMiaoqian Lin <linmq006@gmail.com>
Tue, 28 Oct 2025 03:16:20 +0000 (11:16 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Nov 2025 09:36:04 +0000 (10:36 +0100)
commit bbde14682eba21d86f5f3d6fe2d371b1f97f1e61 upstream.

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 <linmq006@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pmdomain/imx/gpc.c

index 80a4dcc77199cfa98f6533c20a4f1cbf0286a7b3..00fdb5a905e2adb6a56edd12db83e0cd6e16d3f9 100644 (file)
@@ -537,6 +537,8 @@ static void imx_gpc_remove(struct platform_device *pdev)
                        return;
                }
        }
+
+       of_node_put(pgc_node);
 }
 
 static struct platform_driver imx_gpc_driver = {