Commit 07091aa
committed
perf/core: Exit early on perf_mmap() fail
When perf_mmap() fails to allocate a buffer, it still invokes the
event_mapped() callback of the related event. On X86 this might increase
the perf_rdpmc_allowed reference counter. But nothing undoes this as
perf_mmap_close() is never called in this case, which causes another
reference count leak.
Return early on failure to prevent that.
Fixes: 1e0fb9e ("perf: Add pmu callbacks to track event mapping and unmapping")
Signed-off-by: Thomas Gleixner <[email protected]>
Reviewed-by: Lorenzo Stoakes <[email protected]>
Cc: [email protected]1 parent 5468c0f commit 07091aa
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7138 | 7138 | | |
7139 | 7139 | | |
7140 | 7140 | | |
| 7141 | + | |
| 7142 | + | |
| 7143 | + | |
7141 | 7144 | | |
7142 | 7145 | | |
7143 | 7146 | | |
7144 | 7147 | | |
7145 | 7148 | | |
7146 | 7149 | | |
7147 | 7150 | | |
7148 | | - | |
7149 | | - | |
| 7151 | + | |
7150 | 7152 | | |
7151 | 7153 | | |
7152 | 7154 | | |
| |||
0 commit comments