Commit e70e78e3 authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Steven Rostedt
Browse files

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


Cc: Ingo Molnar <>
Cc: Frederic Weisbecker <>
Cc: Masami Hiramatsu <>
Cc: # 3.10
Signed-off-by: default avatarOleg Nesterov <>
Signed-off-by: default avatarSteven Rostedt <>
parent a644a7e9
......@@ -4959,8 +4959,6 @@ static int tracing_buffers_open(struct inode *inode, struct file *filp)
info-> = tr;
info->iter.cpu_file = tc->cpu;
info->iter.trace = tr->current_trace;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment