Skip to content

Commit

Permalink
arm64: spin-table: add missing of_node_put()
Browse files Browse the repository at this point in the history
Since of_get_cpu_node() increments refcount, the node should be put.

Signed-off-by: Masahiro Yamada <[email protected]>
Acked-by: Will Deacon <[email protected]>
Signed-off-by: Catalin Marinas <[email protected]>
  • Loading branch information
masahir0y authored and ctmarinas committed Apr 20, 2016
1 parent adb4907 commit 2fee7d5
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions arch/arm64/kernel/smp_spin_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ static void write_pen_release(u64 val)
static int smp_spin_table_cpu_init(unsigned int cpu)
{
struct device_node *dn;
int ret;

dn = of_get_cpu_node(cpu, NULL);
if (!dn)
Expand All @@ -60,15 +61,15 @@ static int smp_spin_table_cpu_init(unsigned int cpu)
/*
* Determine the address from which the CPU is polling.
*/
if (of_property_read_u64(dn, "cpu-release-addr",
&cpu_release_addr[cpu])) {
ret = of_property_read_u64(dn, "cpu-release-addr",
&cpu_release_addr[cpu]);
if (ret)
pr_err("CPU %d: missing or invalid cpu-release-addr property\n",
cpu);

return -1;
}
of_node_put(dn);

return 0;
return ret;
}

static int smp_spin_table_cpu_prepare(unsigned int cpu)
Expand Down

0 comments on commit 2fee7d5

Please sign in to comment.