mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
perf: Fix context leak in put_event()
Commit:a83fe28e2e("perf: Fix put_event() ctx lock") changed the locking logic in put_event() by replacing mutex_lock_nested() with perf_event_ctx_lock_nested(), but didn't fix the subsequent mutex_unlock() with a correct counterpart, perf_event_ctx_unlock(). Contexts are thus leaked as a result of incremented refcount in perf_event_ctx_lock_nested(). Signed-off-by: Leon Yu <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Fixes:a83fe28e2e("perf: Fix put_event() ctx lock") Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
parent
e678fefa07
commit
d415a7f1c1
1 changed files with 1 additions and 1 deletions
|
|
@ -3591,7 +3591,7 @@ static void put_event(struct perf_event *event)
|
|||
ctx = perf_event_ctx_lock_nested(event, SINGLE_DEPTH_NESTING);
|
||||
WARN_ON_ONCE(ctx->parent_ctx);
|
||||
perf_remove_from_context(event, true);
|
||||
mutex_unlock(&ctx->mutex);
|
||||
perf_event_ctx_unlock(event, ctx);
|
||||
|
||||
_free_event(event);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue