pmdomain: ti-sci: Add missing of_node_put() for args.np

[ Upstream commit afc2331ef81657493c074592c409dac7c3cb8ccc ]

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: efa5c01cd7 ("soc: ti: ti_sci_pm_domains: switch to use multiple genpds instead of one")
Signed-off-by: Zhang Zekun <zhangzekun11@huawei.com>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
Message-ID: <20241024030442.119506-2-zhangzekun11@huawei.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Zhang Zekun
2024-10-24 11:04:41 +08:00
committed by Greg Kroah-Hartman
parent 5a2f0e663c
commit aecbbaf2c0

View File

@@ -165,6 +165,7 @@ static int ti_sci_pm_domain_probe(struct platform_device *pdev)
break; break;
if (args.args_count >= 1 && args.np == dev->of_node) { if (args.args_count >= 1 && args.np == dev->of_node) {
of_node_put(args.np);
if (args.args[0] > max_id) { if (args.args[0] > max_id) {
max_id = args.args[0]; max_id = args.args[0];
} else { } else {
@@ -192,7 +193,10 @@ static int ti_sci_pm_domain_probe(struct platform_device *pdev)
pm_genpd_init(&pd->pd, NULL, true); pm_genpd_init(&pd->pd, NULL, true);
list_add(&pd->node, &pd_provider->pd_list); list_add(&pd->node, &pd_provider->pd_list);
} else {
of_node_put(args.np);
} }
index++; index++;
} }
} }