Commit 0c67b40872326a5340cab51d79a192a5fbaeb484

Authored by Peter Zijlstra
Committed by Ingo Molnar
1 parent cde8e88498

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 <gorcunov@gmail.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

Showing 1 changed file with 3 additions and 1 deletions Side-by-side Diff

... ... @@ -2150,7 +2150,9 @@
2150 2150 if (event->destroy)
2151 2151 event->destroy(event);
2152 2152  
2153   - put_ctx(event->ctx);
  2153 + if (event->ctx)
  2154 + put_ctx(event->ctx);
  2155 +
2154 2156 call_rcu(&event->rcu_head, free_event_rcu);
2155 2157 }
2156 2158