From: Li Zefan Date: Thu, 15 Jan 2009 01:30:52 +0000 (+0800) Subject: tracing/ftrace: add missing unlock in register_stat_tracer() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=42fab4b2cdc02cf28e2474ccfd75bc9225076590;p=linux-beck.git tracing/ftrace: add missing unlock in register_stat_tracer() We should unlock all_stat_sessions_mutex before returning failure. Signed-off-by: Li Zefan Signed-off-by: Steven Rostedt Signed-off-by: Ingo Molnar --- diff --git a/kernel/trace/trace_stat.c b/kernel/trace/trace_stat.c index cb29282b9485..2110cea2ece3 100644 --- a/kernel/trace/trace_stat.c +++ b/kernel/trace/trace_stat.c @@ -73,8 +73,10 @@ int register_stat_tracer(struct tracer_stat *trace) /* Already registered? */ mutex_lock(&all_stat_sessions_mutex); list_for_each_entry_safe(node, tmp, &all_stat_sessions, session_list) { - if (node->ts == trace) + if (node->ts == trace) { + mutex_unlock(&all_stat_sessions_mutex); return -EINVAL; + } } mutex_unlock(&all_stat_sessions_mutex);