提交 8e0c34b0 编写于 作者: S Stephen Boyd 提交者: Russell King

ARM: 8402/1: 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: NStephen Boyd <sboyd@codeaurora.org>
Signed-off-by: NWill Deacon <will.deacon@arm.com>
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 df9de3c4
...@@ -818,12 +818,13 @@ static int of_pmu_irq_cfg(struct arm_pmu *pmu) ...@@ -818,12 +818,13 @@ static int of_pmu_irq_cfg(struct arm_pmu *pmu)
if (arch_find_n_match_cpu_physical_id(dn, cpu, NULL)) if (arch_find_n_match_cpu_physical_id(dn, cpu, NULL))
break; break;
of_node_put(dn);
if (cpu >= nr_cpu_ids) { if (cpu >= nr_cpu_ids) {
pr_warn("Failed to find logical CPU for %s\n", pr_warn("Failed to find logical CPU for %s\n",
dn->name); dn->name);
of_node_put(dn);
break; break;
} }
of_node_put(dn);
irqs[i] = cpu; irqs[i] = cpu;
cpumask_set_cpu(cpu, &pmu->supported_cpus); cpumask_set_cpu(cpu, &pmu->supported_cpus);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册