summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-uniphier
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2016-04-15 12:48:29 +0200
committerArnd Bergmann <arnd@arndb.de>2016-04-26 00:12:22 +0200
commit01bbcdffa90d13f61d8034ef82a68484edbc2f5c (patch)
treec1be391aec9c5510ad4152f97ccec51bd4cf34a4 /arch/arm/mach-uniphier
parentMerge tag 'renesas-soc-for-v4.7' of git://git.kernel.org/pub/scm/linux/kernel... (diff)
downloadlinux-01bbcdffa90d13f61d8034ef82a68484edbc2f5c.tar.xz
linux-01bbcdffa90d13f61d8034ef82a68484edbc2f5c.zip
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>
Diffstat (limited to 'arch/arm/mach-uniphier')
-rw-r--r--arch/arm/mach-uniphier/platsmp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm/mach-uniphier/platsmp.c b/arch/arm/mach-uniphier/platsmp.c
index 69141357afe8..8693b7c15d59 100644
--- a/arch/arm/mach-uniphier/platsmp.c
+++ b/arch/arm/mach-uniphier/platsmp.c
@@ -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;