summaryrefslogtreecommitdiffstats
path: root/arch/riscv
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2019-01-07 15:16:35 +0100
committerPalmer Dabbelt <palmer@sifive.com>2019-01-23 21:56:19 +0100
commit2bb10639f12c925faeed8b4c3678fb92f97b90b7 (patch)
tree97edd1f10c31d35d3c3d0563d8392bfbdebf74ab /arch/riscv
parentRISC-V: Add _TIF_NEED_RESCHED check for kernel thread when CONFIG_PREEMPT=y (diff)
downloadlinux-2bb10639f12c925faeed8b4c3678fb92f97b90b7.tar.xz
linux-2bb10639f12c925faeed8b4c3678fb92f97b90b7.zip
RISC-V: fix bad use of of_node_put
of_find_node_by_type already calls of_node_put, don't call it again. Fixes: 94f9bf118f ("RISC-V: Fix of_node_* refcount") Signed-off-by: Andreas Schwab <schwab@suse.de> Reviewed-by: Atish Patra <atish.patra@wdc.com> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Diffstat (limited to 'arch/riscv')
-rw-r--r--arch/riscv/kernel/smpboot.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/arch/riscv/kernel/smpboot.c b/arch/riscv/kernel/smpboot.c
index fc185ecabb0a..18cda0e8cf94 100644
--- a/arch/riscv/kernel/smpboot.c
+++ b/arch/riscv/kernel/smpboot.c
@@ -57,15 +57,12 @@ void __init setup_smp(void)
while ((dn = of_find_node_by_type(dn, "cpu"))) {
hart = riscv_of_processor_hartid(dn);
- if (hart < 0) {
- of_node_put(dn);
+ if (hart < 0)
continue;
- }
if (hart == cpuid_to_hartid_map(0)) {
BUG_ON(found_boot_cpu);
found_boot_cpu = 1;
- of_node_put(dn);
continue;
}
@@ -73,7 +70,6 @@ void __init setup_smp(void)
set_cpu_possible(cpuid, true);
set_cpu_present(cpuid, true);
cpuid++;
- of_node_put(dn);
}
BUG_ON(!found_boot_cpu);