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>
/* 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);