[PATCH] pmdomain: samsung: fix device node leak in exynos_pd_probe()

Ulf Hansson ulf.hansson at oss.qualcomm.com
Thu Nov 26 05:32:20 PST 2026


On Thu, Nov 26, 2026 at 5:26 AM Yuwei Chen <2522445001 at qq.com> wrote:
>
> exynos_pd_probe() looks up the parent power domain with
> of_parse_phandle_with_args(). The caller must of_node_put() the node
> returned in parent.np. of_genpd_add_subdomain() only compares that
> pointer, and probe never drops it, so each domain with a parent leaks
> one reference. child.np is assigned from dev->of_node and already
> belongs to the device.
>
> The lookup runs from core_initcall. The extra reference pins that
> static parent node for the rest of the boot.
>
> Drop parent.np after the subdomain is registered and after the
> messages that print the node.
>
> Earlier trees keep this driver at drivers/soc/samsung/pm_domains.c, so
> this diff does not apply there.
>
> Fixes: c09a3e6c97f0 ("soc: samsung: pm_domains: Convert to regular platform driver")
> Cc: stable at vger.kernel.org # v6.6+
> Signed-off-by: Yuwei Chen <2522445001 at qq.com>

Applied for fixes and by slimming down the commit message a bit, thanks!

Kind regards
Uffe


> ---
>  drivers/pmdomain/samsung/exynos-pm-domains.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/pmdomain/samsung/exynos-pm-domains.c b/drivers/pmdomain/samsung/exynos-pm-domains.c
> index c8c2ea06e990..01017c406fe6 100644
> --- a/drivers/pmdomain/samsung/exynos-pm-domains.c
> +++ b/drivers/pmdomain/samsung/exynos-pm-domains.c
> @@ -153,6 +153,7 @@ static int exynos_pd_probe(struct platform_device *pdev)
>                 else
>                         pr_info("%pOF has as child subdomain: %pOF.\n",
>                                 parent.np, child.np);
> +               of_node_put(parent.np);
>         }
>
>         pm_runtime_enable(dev);
>
> base-commit: 8d7fe9885c62fc9a95bf55d9db244d9672a8aadc
> --
> 2.53.0.windows.2
>



More information about the linux-arm-kernel mailing list