Skip to content

Commit

Permalink
drivers/perf: arm_pmu: Fix NULL pointer dereference during probe
Browse files Browse the repository at this point in the history
Patch 7f1d642 ("drivers/perf: arm-pmu: Fix handling of SPI lacking
interrupt-affinity property") unintended also fixes perf_event support
for bcm2835 which doesn't have PMU interrupts. Unfortunately this change
introduce a NULL pointer dereference on bcm2835, because irq_is_percpu
always expected to be called with a valid IRQ. So fix this regression
by validating the IRQ before.

Tested-by: Kevin Hilman <[email protected]>
Signed-off-by: Stefan Wahren <[email protected]>
Fixes: 7f1d642 ("drivers/perf: arm-pmu: Fix handling of SPI lacking "interrupt-affinity" property")
Signed-off-by: Will Deacon <[email protected]>
Signed-off-by: Catalin Marinas <[email protected]>
  • Loading branch information
lategoodbye authored and ctmarinas committed Sep 2, 2016
1 parent 7532468 commit 63fb0a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/perf/arm_pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ static int of_pmu_irq_cfg(struct arm_pmu *pmu)
if (cpumask_weight(&pmu->supported_cpus) == 0) {
int irq = platform_get_irq(pdev, 0);

if (irq_is_percpu(irq)) {
if (irq >= 0 && irq_is_percpu(irq)) {
/* If using PPIs, check the affinity of the partition */
int ret;

Expand Down

0 comments on commit 63fb0a9

Please sign in to comment.