Commit 2e97942f authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

perf_events, trace: Fix perf_trace_destroy(), mutex went missing

Steve spotted I forgot to do the destroy under event_mutex.
Reported-by: default avatarSteven Rostedt <rostedt@goodmis.org>
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1274451913.1674.1707.camel@laptop>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 3771f077
...@@ -132,8 +132,9 @@ void perf_trace_destroy(struct perf_event *p_event) ...@@ -132,8 +132,9 @@ void perf_trace_destroy(struct perf_event *p_event)
struct ftrace_event_call *tp_event = p_event->tp_event; struct ftrace_event_call *tp_event = p_event->tp_event;
int i; int i;
mutex_lock(&event_mutex);
if (--tp_event->perf_refcount > 0) if (--tp_event->perf_refcount > 0)
return; goto out;
if (tp_event->class->reg) if (tp_event->class->reg)
tp_event->class->reg(tp_event, TRACE_REG_PERF_UNREGISTER); tp_event->class->reg(tp_event, TRACE_REG_PERF_UNREGISTER);
...@@ -157,6 +158,8 @@ void perf_trace_destroy(struct perf_event *p_event) ...@@ -157,6 +158,8 @@ void perf_trace_destroy(struct perf_event *p_event)
perf_trace_buf[i] = NULL; perf_trace_buf[i] = NULL;
} }
} }
out:
mutex_unlock(&event_mutex);
} }
__kprobes void *perf_trace_buf_prepare(int size, unsigned short type, __kprobes void *perf_trace_buf_prepare(int size, unsigned short type,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment