diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2016-04-19 21:23:31 -0400 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2016-04-20 05:35:15 -0400 |
commit | 2fee7d5b08b6419bb59de9e875d895e3a6e7bf5a (patch) | |
tree | 8dc5220b52edeb59816fa9ef0c1abff4ce3b9a36 /arch/arm64/kernel/smp_spin_table.c | |
parent | adb4907007445ab9d392f4ce398cd7fa5d26612b (diff) |
arm64: spin-table: add missing of_node_put()
Since of_get_cpu_node() increments refcount, the node should be put.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/kernel/smp_spin_table.c')
-rw-r--r-- | arch/arm64/kernel/smp_spin_table.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/arm64/kernel/smp_spin_table.c b/arch/arm64/kernel/smp_spin_table.c index aef3605a8c47..18a71bcd26ee 100644 --- a/arch/arm64/kernel/smp_spin_table.c +++ b/arch/arm64/kernel/smp_spin_table.c | |||
@@ -52,6 +52,7 @@ static void write_pen_release(u64 val) | |||
52 | static int smp_spin_table_cpu_init(unsigned int cpu) | 52 | static int smp_spin_table_cpu_init(unsigned int cpu) |
53 | { | 53 | { |
54 | struct device_node *dn; | 54 | struct device_node *dn; |
55 | int ret; | ||
55 | 56 | ||
56 | dn = of_get_cpu_node(cpu, NULL); | 57 | dn = of_get_cpu_node(cpu, NULL); |
57 | if (!dn) | 58 | if (!dn) |
@@ -60,15 +61,15 @@ static int smp_spin_table_cpu_init(unsigned int cpu) | |||
60 | /* | 61 | /* |
61 | * Determine the address from which the CPU is polling. | 62 | * Determine the address from which the CPU is polling. |
62 | */ | 63 | */ |
63 | if (of_property_read_u64(dn, "cpu-release-addr", | 64 | ret = of_property_read_u64(dn, "cpu-release-addr", |
64 | &cpu_release_addr[cpu])) { | 65 | &cpu_release_addr[cpu]); |
66 | if (ret) | ||
65 | pr_err("CPU %d: missing or invalid cpu-release-addr property\n", | 67 | pr_err("CPU %d: missing or invalid cpu-release-addr property\n", |
66 | cpu); | 68 | cpu); |
67 | 69 | ||
68 | return -1; | 70 | of_node_put(dn); |
69 | } | ||
70 | 71 | ||
71 | return 0; | 72 | return ret; |
72 | } | 73 | } |
73 | 74 | ||
74 | static int smp_spin_table_cpu_prepare(unsigned int cpu) | 75 | static int smp_spin_table_cpu_prepare(unsigned int cpu) |