Skip to content

Commit

Permalink
tracing/ftrace: add missing unlock in register_stat_tracer()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Li Zefan authored and Ingo Molnar committed Jan 15, 2009
1 parent 4a2b8dd commit 42fab4b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kernel/trace/trace_stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 42fab4b

Please sign in to comment.