[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-e5f4d3394a52ac351f1a479fe136d92fa5228eff@git.kernel.org>
Date: Fri, 10 Sep 2010 15:48:20 GMT
From: tip-bot for Peter Zijlstra <a.p.zijlstra@...llo.nl>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
a.p.zijlstra@...llo.nl, tglx@...utronix.de, mingo@...e.hu
Subject: [tip:perf/core] perf: Fix perf_init_event()
Commit-ID: e5f4d3394a52ac351f1a479fe136d92fa5228eff
Gitweb: http://git.kernel.org/tip/e5f4d3394a52ac351f1a479fe136d92fa5228eff
Author: Peter Zijlstra <a.p.zijlstra@...llo.nl>
AuthorDate: Fri, 10 Sep 2010 17:38:06 +0200
Committer: Ingo Molnar <mingo@...e.hu>
CommitDate: Fri, 10 Sep 2010 17:41:55 +0200
perf: Fix perf_init_event()
We ought to return -ENOENT when non of the registered PMUs
recognise the requested event.
This fixes a boot crash that occurs if no PMU is available
but the NMI watchdog tries to register an event.
Reported-by: Ingo Molnar <mingo@...e.hu>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
kernel/perf_event.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index f395fb4..f29b525 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -5236,12 +5236,15 @@ struct pmu *perf_init_event(struct perf_event *event)
list_for_each_entry_rcu(pmu, &pmus, entry) {
int ret = pmu->event_init(event);
if (!ret)
- break;
+ goto unlock;
+
if (ret != -ENOENT) {
pmu = ERR_PTR(ret);
- break;
+ goto unlock;
}
}
+ pmu = ERR_PTR(-ENOENT);
+unlock:
srcu_read_unlock(&pmus_srcu, idx);
return pmu;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists