summaryrefslogtreecommitdiff
path: root/kernel/trace/trace_stat.c
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2009-01-15 09:30:52 +0800
committerIngo Molnar <mingo@elte.hu>2009-01-15 11:28:32 +0100
commit42fab4b2cdc02cf28e2474ccfd75bc9225076590 (patch)
tree22a620e154b2d73df89747a2d0b3bf6efc2f064b /kernel/trace/trace_stat.c
parent4a2b8dda3f8705880ec7408135645602d5590f51 (diff)
tracing/ftrace: add missing unlock in register_stat_tracer()
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>
Diffstat (limited to 'kernel/trace/trace_stat.c')
-rw-r--r--kernel/trace/trace_stat.c4
1 files changed, 3 insertions, 1 deletions
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);