tracing: Fix return while holding a lock in register_tracer()
authorChunyu Hu <chuhu@redhat.com>
Mon, 14 Mar 2016 12:35:41 +0000 (20:35 +0800)
committerSteven Rostedt <rostedt@goodmis.org>
Fri, 18 Mar 2016 14:36:21 +0000 (10:36 -0400)
commitc8ca003b2fde177b83de87f9f20f6a5933fb50bf
tree05f03d5ecb63b05c86a4846902b2d7b05731cc29
parent6363c6b599ae67b779d01a48642a7c0d7d721814
tracing: Fix return while holding a lock in register_tracer()

commit d39cdd2036a6 ("tracing: Make tracer_flags use the right set_flag
callback")  introduces a potential mutex deadlock issue, as it forgets to
free the mutex when allocaing the tracer_flags gets fail.

The issue was found by Dan Carpenter through Smatch static code check tool.

Link: http://lkml.kernel.org/r/1457958941-30265-1-git-send-email-chuhu@redhat.com
Fixes: d39cdd2036a6 ("tracing: Make tracer_flags use the right set_flag callback")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Chunyu Hu <chuhu@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/trace.c