提交 42fab4b2 编写于 作者: L Li Zefan 提交者: Ingo Molnar

tracing/ftrace: add missing unlock in register_stat_tracer()

We should unlock all_stat_sessions_mutex before returning failure.
Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 4a2b8dda
...@@ -73,8 +73,10 @@ int register_stat_tracer(struct tracer_stat *trace) ...@@ -73,8 +73,10 @@ int register_stat_tracer(struct tracer_stat *trace)
/* Already registered? */ /* Already registered? */
mutex_lock(&all_stat_sessions_mutex); mutex_lock(&all_stat_sessions_mutex);
list_for_each_entry_safe(node, tmp, &all_stat_sessions, session_list) { 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; return -EINVAL;
}
} }
mutex_unlock(&all_stat_sessions_mutex); mutex_unlock(&all_stat_sessions_mutex);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册