Skip to content

Commit 2bb1063

Browse files
andreas-schwabpalmer-dabbelt
authored andcommitted
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: 94f9bf1 ("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>
1 parent 99fd6e8 commit 2bb1063

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

arch/riscv/kernel/smpboot.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,23 +57,19 @@ void __init setup_smp(void)
5757

5858
while ((dn = of_find_node_by_type(dn, "cpu"))) {
5959
hart = riscv_of_processor_hartid(dn);
60-
if (hart < 0) {
61-
of_node_put(dn);
60+
if (hart < 0)
6261
continue;
63-
}
6462

6563
if (hart == cpuid_to_hartid_map(0)) {
6664
BUG_ON(found_boot_cpu);
6765
found_boot_cpu = 1;
68-
of_node_put(dn);
6966
continue;
7067
}
7168

7269
cpuid_to_hartid_map(cpuid) = hart;
7370
set_cpu_possible(cpuid, true);
7471
set_cpu_present(cpuid, true);
7572
cpuid++;
76-
of_node_put(dn);
7773
}
7874

7975
BUG_ON(!found_boot_cpu);

0 commit comments

Comments
 (0)