diff options
author | Oleg Nesterov <oleg@redhat.com> | 2013-07-19 11:36:44 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2013-07-19 14:32:22 -0400 |
commit | e70e78e3c83b536730e31231dd9b979768d8df3c (patch) | |
tree | d7aedcba5c94bdcaaf0e08b945e7a7639e2c283c /kernel/trace | |
parent | a644a7e9587802eabb2e229177606f6a74a60fc1 (diff) |
tracing: Kill the unbalanced tr->ref++ in tracing_buffers_open()
tracing_buffers_open() does trace_array_get() and then it wrongly
inrcements tr->ref again under trace_types_lock. This means that
every caller leaks trace_array:
# cd /sys/kernel/debug/tracing/
# mkdir instances/X
# true < instances/X/per_cpu/cpu0/trace_pipe_raw
# rmdir instances/X
rmdir: failed to remove `instances/X': Device or resource busy
Link: http://lkml.kernel.org/r/20130719153644.GA18899@redhat.com
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: stable@vger.kernel.org # 3.10
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/trace.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 7d9ceab42564..3f2477713aca 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -4959,8 +4959,6 @@ static int tracing_buffers_open(struct inode *inode, struct file *filp) | |||
4959 | 4959 | ||
4960 | mutex_lock(&trace_types_lock); | 4960 | mutex_lock(&trace_types_lock); |
4961 | 4961 | ||
4962 | tr->ref++; | ||
4963 | |||
4964 | info->iter.tr = tr; | 4962 | info->iter.tr = tr; |
4965 | info->iter.cpu_file = tc->cpu; | 4963 | info->iter.cpu_file = tc->cpu; |
4966 | info->iter.trace = tr->current_trace; | 4964 | info->iter.trace = tr->current_trace; |