diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2010-09-13 05:15:58 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-09-13 11:08:42 -0400 |
commit | 0c67b40872326a5340cab51d79a192a5fbaeb484 (patch) | |
tree | e92b420dcb1375e159842d8ffa03a5230976ab3a /kernel/perf_event.c | |
parent | cde8e88498c8de69271fcb6d4dd974979368fa67 (diff) |
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>
Diffstat (limited to 'kernel/perf_event.c')
-rw-r--r-- | kernel/perf_event.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c index bc46bff69620..440f9ca067b2 100644 --- a/kernel/perf_event.c +++ b/kernel/perf_event.c | |||
@@ -2150,7 +2150,9 @@ static void free_event(struct perf_event *event) | |||
2150 | if (event->destroy) | 2150 | if (event->destroy) |
2151 | event->destroy(event); | 2151 | event->destroy(event); |
2152 | 2152 | ||
2153 | put_ctx(event->ctx); | 2153 | if (event->ctx) |
2154 | put_ctx(event->ctx); | ||
2155 | |||
2154 | call_rcu(&event->rcu_head, free_event_rcu); | 2156 | call_rcu(&event->rcu_head, free_event_rcu); |
2155 | } | 2157 | } |
2156 | 2158 | ||