|
@@ -6098,17 +6098,22 @@ struct pmu *perf_init_event(struct perf_event *event)
|
|
{
|
|
{
|
|
struct pmu *pmu = NULL;
|
|
struct pmu *pmu = NULL;
|
|
int idx;
|
|
int idx;
|
|
|
|
+ int ret;
|
|
|
|
|
|
idx = srcu_read_lock(&pmus_srcu);
|
|
idx = srcu_read_lock(&pmus_srcu);
|
|
|
|
|
|
rcu_read_lock();
|
|
rcu_read_lock();
|
|
pmu = idr_find(&pmu_idr, event->attr.type);
|
|
pmu = idr_find(&pmu_idr, event->attr.type);
|
|
rcu_read_unlock();
|
|
rcu_read_unlock();
|
|
- if (pmu)
|
|
|
|
|
|
+ if (pmu) {
|
|
|
|
+ ret = pmu->event_init(event);
|
|
|
|
+ if (ret)
|
|
|
|
+ pmu = ERR_PTR(ret);
|
|
goto unlock;
|
|
goto unlock;
|
|
|
|
+ }
|
|
|
|
|
|
list_for_each_entry_rcu(pmu, &pmus, entry) {
|
|
list_for_each_entry_rcu(pmu, &pmus, entry) {
|
|
- int ret = pmu->event_init(event);
|
|
|
|
|
|
+ ret = pmu->event_init(event);
|
|
if (!ret)
|
|
if (!ret)
|
|
goto unlock;
|
|
goto unlock;
|
|
|
|
|