* [PATCH] soc: imx: gpc: fix reference count leak in imx_gpc_remove
@ 2025-10-28 3:16 Miaoqian Lin
2025-11-04 16:33 ` Ulf Hansson
0 siblings, 1 reply; 2+ messages in thread
From: Miaoqian Lin @ 2025-10-28 3:16 UTC (permalink / raw)
To: Ulf Hansson, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, Rob Herring (Arm), Wolfram Sang, Lucas Stach,
linux-pm, imx, linux-arm-kernel, linux-kernel
Cc: linmq006, stable
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")
Cc: stable@vger.kernel.org
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
drivers/pmdomain/imx/gpc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/pmdomain/imx/gpc.c b/drivers/pmdomain/imx/gpc.c
index 33991f3c6b55..a34b260274f7 100644
--- a/drivers/pmdomain/imx/gpc.c
+++ b/drivers/pmdomain/imx/gpc.c
@@ -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)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] soc: imx: gpc: fix reference count leak in imx_gpc_remove
2025-10-28 3:16 [PATCH] soc: imx: gpc: fix reference count leak in imx_gpc_remove Miaoqian Lin
@ 2025-11-04 16:33 ` Ulf Hansson
0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2025-11-04 16:33 UTC (permalink / raw)
To: Miaoqian Lin
Cc: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Rob Herring (Arm), Wolfram Sang, Lucas Stach, linux-pm, imx,
linux-arm-kernel, linux-kernel, stable
On Tue, 28 Oct 2025 at 04:16, Miaoqian Lin <linmq006@gmail.com> wrote:
>
> 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")
> Cc: stable@vger.kernel.org
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Applied for fixes, thanks!
Kind regards
Uffe
> ---
> drivers/pmdomain/imx/gpc.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/pmdomain/imx/gpc.c b/drivers/pmdomain/imx/gpc.c
> index 33991f3c6b55..a34b260274f7 100644
> --- a/drivers/pmdomain/imx/gpc.c
> +++ b/drivers/pmdomain/imx/gpc.c
> @@ -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)
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-11-04 16:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-28 3:16 [PATCH] soc: imx: gpc: fix reference count leak in imx_gpc_remove Miaoqian Lin
2025-11-04 16:33 ` Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).