提交 0c67b408 编写于 作者: P Peter Zijlstra 提交者: Ingo Molnar

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: NCyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 cde8e884
...@@ -2150,7 +2150,9 @@ static void free_event(struct perf_event *event) ...@@ -2150,7 +2150,9 @@ static void free_event(struct perf_event *event)
if (event->destroy) if (event->destroy)
event->destroy(event); event->destroy(event);
put_ctx(event->ctx); if (event->ctx)
put_ctx(event->ctx);
call_rcu(&event->rcu_head, free_event_rcu); call_rcu(&event->rcu_head, free_event_rcu);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册