tracing/ftrace: add missing unlock in register_stat_tracer()
authorLi Zefan <lizf@cn.fujitsu.com>
Thu, 15 Jan 2009 01:30:52 +0000 (09:30 +0800)
committerIngo Molnar <mingo@elte.hu>
Thu, 15 Jan 2009 10:28:32 +0000 (11:28 +0100)
We should unlock all_stat_sessions_mutex before returning failure.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/trace/trace_stat.c

index cb29282b94857b282946adbddc27f07431e7cb31..2110cea2ece3457ef7ac2e3937a36aa6afb0f762 100644 (file)
@@ -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);