Skip to content

Commit 6704bca

Browse files
Zhang Zekunsmb49
authored andcommitted
pmdomain: ti-sci: Add missing of_node_put() for args.np
BugLink: https://bugs.launchpad.net/bugs/2101915 [ Upstream commit afc2331 ] 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: efa5c01 ("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> Signed-off-by: Koichiro Den <koichiro.den@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
1 parent e7ce1ec commit 6704bca

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/pmdomain/ti/ti_sci_pm_domains.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ static int ti_sci_pm_domain_probe(struct platform_device *pdev)
161161
break;
162162

163163
if (args.args_count >= 1 && args.np == dev->of_node) {
164+
of_node_put(args.np);
164165
if (args.args[0] > max_id) {
165166
max_id = args.args[0];
166167
} else {
@@ -192,7 +193,10 @@ static int ti_sci_pm_domain_probe(struct platform_device *pdev)
192193
pm_genpd_init(&pd->pd, NULL, true);
193194

194195
list_add(&pd->node, &pd_provider->pd_list);
196+
} else {
197+
of_node_put(args.np);
195198
}
199+
196200
index++;
197201
}
198202
}

0 commit comments

Comments
 (0)