aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 cb29282b948..2110cea2ece 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);