diff options
author | Stephen Boyd <sboyd@codeaurora.org> | 2015-06-03 21:53:37 +0100 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2015-06-30 18:13:03 +0100 |
commit | 18a11b5e79697ddc61e30181737c91ce21eaa859 (patch) | |
tree | 61d10528dd4ae8e0a9222b8fd60b8f0be193a758 /arch/arm64 | |
parent | 1e43ba9cd867f05f3e85579c370b939e1ce585e9 (diff) | |
download | blackbird-obmc-linux-18a11b5e79697ddc61e30181737c91ce21eaa859.tar.gz blackbird-obmc-linux-18a11b5e79697ddc61e30181737c91ce21eaa859.zip |
arm64: perf: Don't use of_node after putting it
It's possible, albeit unlikely, that using the of_node here will
reference freed memory. Call of_node_put() after printing the
name to be safe.
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64')
-rw-r--r-- | arch/arm64/kernel/perf_event.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c index 702591f6180a..8af7784a8e35 100644 --- a/arch/arm64/kernel/perf_event.c +++ b/arch/arm64/kernel/perf_event.c @@ -1340,12 +1340,13 @@ static int armpmu_device_probe(struct platform_device *pdev) if (arch_find_n_match_cpu_physical_id(dn, cpu, NULL)) break; - of_node_put(dn); if (cpu >= nr_cpu_ids) { pr_warn("Failed to find logical CPU for %s\n", dn->name); + of_node_put(dn); break; } + of_node_put(dn); irqs[i] = cpu; } |