Commit: 66d258c5b048 ("perf/core: Optimize perf_init_event()") introduced an unlock imbalance in perf_init_event() where it calls "goto again" and then only repeat rcu_read_unlock().
Unified · Split
| @@ -10307,7 +10307,6 @@ static struct pmu *perf_init_event(struct perf_event *event) · 10306 unmodified lines | ||
| 10307 | 10307 | goto unlock; |
| 10308 | 10308 | } |
| 10309 | 10309 | |
| 10310 | − rcu_read_lock(); | |
| 10311 | 10310 | /* |
| 10312 | 10311 | * PERF_TYPE_HARDWARE and PERF_TYPE_HW_CACHE |
| 10313 | 10312 | * are often aliases for PERF_TYPE_RAW. |
| @@ -10317,6 +10316,7 @@ static struct pmu *perf_init_event(struct perf_event *event) · 3 unmodified lines | ||
| 10317 | 10316 | type = PERF_TYPE_RAW; |
| 10318 | 10317 | |
| 10319 | 10318 | again: |
| 10319 | + rcu_read_lock(); | |
| 10320 | 10320 | pmu = idr_find(&pmu_idr, type); |
| 10321 | 10321 | rcu_read_unlock(); |
| 10322 | 10322 | if (pmu) { |