From: Stefan Wahren <stefan.wahren@i2se.com>
To: Mark Rutland <mark.rutland@arm.com>, Will Deacon <will.deacon@arm.com>
Cc: Eric Anholt <eric@anholt.net>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Stefan Wahren <stefan.wahren@i2se.com>
Subject: [PATCH 2/2] drivers/perf: arm_pmu: Fix NULL pointer dereference during probe
Date: Sat, 27 Aug 2016 16:19:50 +0000 [thread overview]
Message-ID: <1472314790-4268-2-git-send-email-stefan.wahren@i2se.com> (raw)
In-Reply-To: <1472314790-4268-1-git-send-email-stefan.wahren@i2se.com>
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.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Fixes: 7f1d642fbb5c ("drivers/perf: arm-pmu: Fix handling of SPI lacking \"interrupt-affinity\" property")
---
drivers/perf/arm_pmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Note: checkpatch.pl complains about the fixes tag, but i don't know how to
escape it correctly.
diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c
index 1b48bf0..f5e1008 100644
--- a/drivers/perf/arm_pmu.c
+++ b/drivers/perf/arm_pmu.c
@@ -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;
--
1.7.9.5
next prev parent reply other threads:[~2016-08-27 16:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-27 16:19 [PATCH 1/2] drivers/perf: arm_pmu: Fix leak in error path Stefan Wahren
2016-08-27 16:19 ` Stefan Wahren [this message]
2016-08-30 11:27 ` [PATCH 2/2] drivers/perf: arm_pmu: Fix NULL pointer dereference during probe Will Deacon
2016-09-01 2:17 ` Kevin Hilman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1472314790-4268-2-git-send-email-stefan.wahren@i2se.com \
--to=stefan.wahren@i2se.com \
--cc=eric@anholt.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®