Patch 7f1d642fbb5c ("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.
Unified · Split
| @@ -970,7 +970,7 @@ static int of_pmu_irq_cfg(struct arm_pmu *pmu) · 969 unmodified lines | |||
| 970 | if (cpumask_weight(&pmu->supported_cpus) == 0) { | 970 | if (cpumask_weight(&pmu->supported_cpus) == 0) { |
| 971 | int irq = platform_get_irq(pdev, 0); | 971 | int irq = platform_get_irq(pdev, 0); |
| 972 | 972 | ||
| 973 | if (irq_is_percpu(irq)) { | 973 | if (irq >= 0 && irq_is_percpu(irq)) { |
| 974 | /* If using PPIs, check the affinity of the partition */ | 974 | /* If using PPIs, check the affinity of the partition */ |
| 975 | int ret; | 975 | int ret; |
| 976 | 976 | ||