1
0
Fork 0

ARM: uniphier: correct the call order of of_node_put()

Put nodes after of_address_to_resource() in case the nodes might be
released while parsing in them.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
hifive-unleashed-5.1
Masahiro Yamada 2016-04-15 19:48:29 +09:00 committed by Arnd Bergmann
parent a3003158b1
commit 01bbcdffa9
1 changed files with 2 additions and 2 deletions

View File

@ -99,16 +99,16 @@ static int __init uniphier_smp_prepare_trampoline(unsigned int max_cpus)
int ret;
np = of_find_compatible_node(NULL, NULL, "socionext,uniphier-smpctrl");
of_node_put(np);
ret = of_address_to_resource(np, 0, &res);
of_node_put(np);
if (!ret) {
rom_rsv2_phys = res.start + UNIPHIER_SMPCTRL_ROM_RSV2;
} else {
/* try old binding too */
np = of_find_compatible_node(NULL, NULL,
"socionext,uniphier-system-bus-controller");
of_node_put(np);
ret = of_address_to_resource(np, 1, &res);
of_node_put(np);
if (ret) {
pr_err("failed to get resource of SMP control\n");
return ret;