From: Zhang Zekun Date: Thu, 24 Oct 2024 03:04:41 +0000 (+0800) Subject: pmdomain: ti-sci: Add missing of_node_put() for args.np X-Git-Tag: v6.13-rc1~154^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=afc2331ef81657493c074592c409dac7c3cb8ccc;p=thirdparty%2Fkernel%2Flinux.git pmdomain: ti-sci: Add missing of_node_put() for args.np of_parse_phandle_with_args() needs to call of_node_put() to decrement the refcount of args.np. So, Add the missing of_node_put() in the loop. Fixes: efa5c01cd7ee ("soc: ti: ti_sci_pm_domains: switch to use multiple genpds instead of one") Signed-off-by: Zhang Zekun Reviewed-by: Dhruva Gole Message-ID: <20241024030442.119506-2-zhangzekun11@huawei.com> Signed-off-by: Ulf Hansson --- diff --git a/drivers/pmdomain/ti/ti_sci_pm_domains.c b/drivers/pmdomain/ti/ti_sci_pm_domains.c index 38448b4a035a9..f145f0225524f 100644 --- a/drivers/pmdomain/ti/ti_sci_pm_domains.c +++ b/drivers/pmdomain/ti/ti_sci_pm_domains.c @@ -161,6 +161,7 @@ static int ti_sci_pm_domain_probe(struct platform_device *pdev) break; if (args.args_count >= 1 && args.np == dev->of_node) { + of_node_put(args.np); if (args.args[0] > max_id) { max_id = args.args[0]; } else { @@ -193,7 +194,10 @@ static int ti_sci_pm_domain_probe(struct platform_device *pdev) pm_genpd_init(&pd->pd, NULL, true); list_add(&pd->node, &pd_provider->pd_list); + } else { + of_node_put(args.np); } + index++; } }