perf: Fix free_event()
Commit-ID: 0c67b40872326a5340cab51d79a192a5fbaeb484 Gitweb: http://git.kernel.org/tip/0c67b40872326a5340cab51d79a192a5fbaeb484 Author: Peter Zijlstra <[email protected]> AuthorDate: Mon, 13 Sep 2010 11:15:58 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Mon, 13 Sep 2010 17:08:42 +0200
perf: Fix free_event()
With the context rework stuff we can actually end up freeing an event before it gets attached to a context.
Reported-by Cyrill Gorcunov <[email protected]>
Signed-off-by Peter Zijlstra <[email protected]>
LKML-Reference: <new-submission>
Signed-off-by Ingo Molnar <[email protected]>
--- kernel/perf_event.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
kernel/perf_event.c +3 -1
@@ -2150,7 +2150,9 @@ static void free_event(struct perf_event *event)if (event->destroy) event->destroy (event); -put_ctx (event->ctx); +if (event->ctx) +put_ctx (event->ctx); +call_rcu (&event->rcu_head, free_event_rcu); }