aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2008-05-12 15:20:56 -0400
committerThomas Gleixner <tglx@linutronix.de>2008-05-23 15:15:52 -0400
commitd15f57f23eaba975309a153b23699cd0c0236974 (patch)
tree8bff39ab0bae5727e691f88e783a2d5cfec2afb1
parent07a267cdd2fd7d1de9455b1e36a1635ace7276c7 (diff)
ftrace: fix mutex unlock in trace output
If the trace output changes on reading the trace files, there is a chance that the start function will return NULL. If the start function of a sequence returns NULL the stop equivalent is not called. In this case, all locks that are taken must be released even if they are released in the stop function. This patch fixes a case that a mutex was not released on return of NULL in the start sequence function. Signed-off-by: Steven Rostedt <srostedt@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--kernel/trace/trace.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 3009aafa4dde..ea11f4ebfae1 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -964,8 +964,10 @@ static void *s_start(struct seq_file *m, loff_t *pos)
964 964
965 mutex_lock(&trace_types_lock); 965 mutex_lock(&trace_types_lock);
966 966
967 if (!current_trace || current_trace != iter->trace) 967 if (!current_trace || current_trace != iter->trace) {
968 mutex_unlock(&trace_types_lock);
968 return NULL; 969 return NULL;
970 }
969 971
970 atomic_inc(&trace_record_cmdline_disabled); 972 atomic_inc(&trace_record_cmdline_disabled);
971 973