tracing/ftrace: add missing unlock in register_stat_tracer()
PATCH 1/1 tracing/ftrace: add missing unlock in register_stat_tracer()
We should unlock all_stat_sessions_mutex before returning failure.
Signed-off-by Li Zefan <[email protected]>
---
I noticed Ingo tend to delete the impact line from my changelog if it added nothing new to the title, so no impact line for this patch. :)
--- kernel/trace/trace_stat.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
kernel/trace/trace_stat.c +3 -1
@@ -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);
Signature · 1 line
1.5.4.rc3
Quoted 3 lines · Li Zefan
We should unlock
all_stat_sessions_mutexbefore returning failure.Signed-off-by Li Zefan <[email protected]>
Thanks, applied.
-- Steve
2009/1/15 Li Zefan <[email protected]>:
Quoted 1 line
We should unlock
all_stat_sessions_mutexbefore returning failure.
Ouch.... Thanks Li!
Quoted 30 lines
Signed-off-by Li Zefan <[email protected]>---
I noticed Ingo tend to delete the impact line from my changelog if it added nothing new to the title, so no impact line for this patch. :)
--- kernel/trace/trace_stat.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)kernel/trace/trace_stat.c +3
-2@@ -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); --1.5.4.rc3