diff options
author | Atish Patra <atish.patra@wdc.com> | 2018-11-20 15:07:50 -0800 |
---|---|---|
committer | Palmer Dabbelt <palmer@sifive.com> | 2018-12-21 08:10:49 -0800 |
commit | 94f9bf118f1e294b3f2092f8bde02860f5e3ea3f (patch) | |
tree | 826070e27c2602f32ca179715c15a25312cda16b /arch/riscv/kernel/smpboot.c | |
parent | 8b699616f399b58071cda41e5a1125d8480ac982 (diff) | |
download | linux-stable-94f9bf118f1e294b3f2092f8bde02860f5e3ea3f.tar.gz linux-stable-94f9bf118f1e294b3f2092f8bde02860f5e3ea3f.tar.bz2 linux-stable-94f9bf118f1e294b3f2092f8bde02860f5e3ea3f.zip |
RISC-V: Fix of_node_* refcount
Fix of_node* refcount at various places by using of_node_put.
Signed-off-by: Atish Patra <atish.patra@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Diffstat (limited to 'arch/riscv/kernel/smpboot.c')
-rw-r--r-- | arch/riscv/kernel/smpboot.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/riscv/kernel/smpboot.c b/arch/riscv/kernel/smpboot.c index 18cda0e8cf94..fc185ecabb0a 100644 --- a/arch/riscv/kernel/smpboot.c +++ b/arch/riscv/kernel/smpboot.c @@ -57,12 +57,15 @@ void __init setup_smp(void) while ((dn = of_find_node_by_type(dn, "cpu"))) { hart = riscv_of_processor_hartid(dn); - if (hart < 0) + if (hart < 0) { + of_node_put(dn); continue; + } if (hart == cpuid_to_hartid_map(0)) { BUG_ON(found_boot_cpu); found_boot_cpu = 1; + of_node_put(dn); continue; } @@ -70,6 +73,7 @@ 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); |