Commit fb659882 authored by Will Deacon's avatar Will Deacon Committed by Arnd Bergmann

drivers/perf: arm_pmu: avoid CPU device_node reference leak

of_cpu_device_node_get increments the reference count on the CPU
device_node, so we must take care to of_node_put once we've finished
with it.

This patch fixes the perf IRQ probing code to avoid the leak.

Cc: Sudeep Holla <>
Cc: Mark Rutland <>
Signed-off-by: default avatarWill Deacon <>
Signed-off-by: default avatarArnd Bergmann <>
parent a0bcbe96
......@@ -823,9 +823,15 @@ static int of_pmu_irq_cfg(struct arm_pmu *pmu)
/* Now look up the logical CPU number */
if (dn == of_cpu_device_node_get(cpu))
for_each_possible_cpu(cpu) {
struct device_node *cpu_dn;
cpu_dn = of_cpu_device_node_get(cpu);
if (dn == cpu_dn)
if (cpu >= nr_cpu_ids) {
pr_warn("Failed to find logical CPU for %s\n",
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment