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>
This commit is contained in:
committed by
Palmer Dabbelt
parent
99fd6e875d
commit
2bb10639f1
@ -57,15 +57,12 @@ void __init setup_smp(void)
|
|||||||
|
|
||||||
while ((dn = of_find_node_by_type(dn, "cpu"))) {
|
while ((dn = of_find_node_by_type(dn, "cpu"))) {
|
||||||
hart = riscv_of_processor_hartid(dn);
|
hart = riscv_of_processor_hartid(dn);
|
||||||
if (hart < 0) {
|
if (hart < 0)
|
||||||
of_node_put(dn);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
if (hart == cpuid_to_hartid_map(0)) {
|
if (hart == cpuid_to_hartid_map(0)) {
|
||||||
BUG_ON(found_boot_cpu);
|
BUG_ON(found_boot_cpu);
|
||||||
found_boot_cpu = 1;
|
found_boot_cpu = 1;
|
||||||
of_node_put(dn);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,7 +70,6 @@ void __init setup_smp(void)
|
|||||||
set_cpu_possible(cpuid, true);
|
set_cpu_possible(cpuid, true);
|
||||||
set_cpu_present(cpuid, true);
|
set_cpu_present(cpuid, true);
|
||||||
cpuid++;
|
cpuid++;
|
||||||
of_node_put(dn);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BUG_ON(!found_boot_cpu);
|
BUG_ON(!found_boot_cpu);
|
||||||
|
Reference in New Issue
Block a user