diff options
author | Masami Hiramatsu <mhiramat@redhat.com> | 2009-09-14 16:49:12 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2009-09-16 22:03:50 -0400 |
commit | 4fead8e46fded93cc0d432ced774d9a3a8d21bad (patch) | |
tree | 10e62eec4074bb2b97d8a37ce29f58a0149d25f9 /kernel/trace | |
parent | 588bebb74fe87270f94c2810652bd683d63c4b54 (diff) |
ftrace: Fix trace_remove_event_call() to lock trace_event_mutex
Lock not only event_mutex but also trace_event_mutex in
trace_remove_event_call() to protect __unregister_ftrace_event().
Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Jim Keniston <jkenisto@us.ibm.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Frank Ch. Eigler <fche@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Jason Baron <jbaron@redhat.com>
Cc: K.Prasad <prasad@linux.vnet.ibm.com>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Li Zefan <lizf@cn.fujitsu.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <20090914204912.18779.68734.stgit@dhcp-100-2-132.bos.redhat.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/trace_events.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 83cc2c01195d..f85b0f1cb942 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
@@ -1054,6 +1054,9 @@ static void remove_subsystem_dir(const char *name) | |||
1054 | } | 1054 | } |
1055 | } | 1055 | } |
1056 | 1056 | ||
1057 | /* | ||
1058 | * Must be called under locking both of event_mutex and trace_event_mutex. | ||
1059 | */ | ||
1057 | static void __trace_remove_event_call(struct ftrace_event_call *call) | 1060 | static void __trace_remove_event_call(struct ftrace_event_call *call) |
1058 | { | 1061 | { |
1059 | ftrace_event_enable_disable(call, 0); | 1062 | ftrace_event_enable_disable(call, 0); |
@@ -1070,7 +1073,9 @@ static void __trace_remove_event_call(struct ftrace_event_call *call) | |||
1070 | void trace_remove_event_call(struct ftrace_event_call *call) | 1073 | void trace_remove_event_call(struct ftrace_event_call *call) |
1071 | { | 1074 | { |
1072 | mutex_lock(&event_mutex); | 1075 | mutex_lock(&event_mutex); |
1076 | down_write(&trace_event_mutex); | ||
1073 | __trace_remove_event_call(call); | 1077 | __trace_remove_event_call(call); |
1078 | up_write(&trace_event_mutex); | ||
1074 | mutex_unlock(&event_mutex); | 1079 | mutex_unlock(&event_mutex); |
1075 | } | 1080 | } |
1076 | 1081 | ||