[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-2e97942fe57864588774f173cf4cd7bb68968b76@git.kernel.org>
Date: Mon, 31 May 2010 07:20:07 GMT
From: tip-bot for Peter Zijlstra <a.p.zijlstra@...llo.nl>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
rostedt@...dmis.org, a.p.zijlstra@...llo.nl, tglx@...utronix.de,
mingo@...e.hu
Subject: [tip:perf/urgent] perf_events, trace: Fix perf_trace_destroy(), mutex went missing
Commit-ID: 2e97942fe57864588774f173cf4cd7bb68968b76
Gitweb: http://git.kernel.org/tip/2e97942fe57864588774f173cf4cd7bb68968b76
Author: Peter Zijlstra <a.p.zijlstra@...llo.nl>
AuthorDate: Fri, 21 May 2010 16:22:33 +0200
Committer: Ingo Molnar <mingo@...e.hu>
CommitDate: Mon, 31 May 2010 08:46:09 +0200
perf_events, trace: Fix perf_trace_destroy(), mutex went missing
Steve spotted I forgot to do the destroy under event_mutex.
Reported-by: Steven Rostedt <rostedt@...dmis.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
LKML-Reference: <1274451913.1674.1707.camel@...top>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
kernel/trace/trace_event_perf.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/kernel/trace/trace_event_perf.c b/kernel/trace/trace_event_perf.c
index 49c7abf..e6f6588 100644
--- a/kernel/trace/trace_event_perf.c
+++ b/kernel/trace/trace_event_perf.c
@@ -132,8 +132,9 @@ void perf_trace_destroy(struct perf_event *p_event)
struct ftrace_event_call *tp_event = p_event->tp_event;
int i;
+ mutex_lock(&event_mutex);
if (--tp_event->perf_refcount > 0)
- return;
+ goto out;
if (tp_event->class->reg)
tp_event->class->reg(tp_event, TRACE_REG_PERF_UNREGISTER);
@@ -157,6 +158,8 @@ void perf_trace_destroy(struct perf_event *p_event)
perf_trace_buf[i] = NULL;
}
}
+out:
+ mutex_unlock(&event_mutex);
}
__kprobes void *perf_trace_buf_prepare(int size, unsigned short type,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists