diff options
author | Lin Ming <ming.m.lin@intel.com> | 2011-02-27 21:13:31 +0800 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-03-04 11:32:50 +0100 |
commit | 940c5b2971de443df22eed0441bc74fb0116e9f5 (patch) | |
tree | 7264bdfcc08d5c6f0223d0d45ba7db4e47cf9957 /kernel/perf_event.c | |
parent | 888a8a3e9d79cbb9d83e53955f684998248580ec (diff) | |
download | blackbird-op-linux-940c5b2971de443df22eed0441bc74fb0116e9f5.tar.gz blackbird-op-linux-940c5b2971de443df22eed0441bc74fb0116e9f5.zip |
perf: Fix the missing event initialization when pmu is found in idr
Currently, the event is not initialized if pmu is found in idr. This
never causes bug just because now no pmu is associated with the idr
id.
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1298812411.2699.9.camel@localhost>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/perf_event.c')
-rw-r--r-- | kernel/perf_event.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c index 64a018e94fca..821ce8221974 100644 --- a/kernel/perf_event.c +++ b/kernel/perf_event.c @@ -6098,17 +6098,22 @@ struct pmu *perf_init_event(struct perf_event *event) { struct pmu *pmu = NULL; int idx; + int ret; idx = srcu_read_lock(&pmus_srcu); rcu_read_lock(); pmu = idr_find(&pmu_idr, event->attr.type); rcu_read_unlock(); - if (pmu) + if (pmu) { + ret = pmu->event_init(event); + if (ret) + pmu = ERR_PTR(ret); goto unlock; + } list_for_each_entry_rcu(pmu, &pmus, entry) { - int ret = pmu->event_init(event); + ret = pmu->event_init(event); if (!ret) goto unlock; |