]> git.ipfire.org Git - thirdparty/kernel/linux.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)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 4 Nov 2025 16:29:00 +0000 (17:29 +0100)
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>
drivers/pmdomain/imx/gpc.c

index 33991f3c6b556470fdd9e3a8930e34c84e7f0001..a34b260274f7bd7d4ac271b2961f48bcc69f16c4 100644 (file)
@@ -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 = {