Skip to content

Commit 037a6cf

Browse files
zhangyi089gregkh
authored andcommitted
tracing: Do not free iter->trace in fail path of tracing_open_pipe()
commit e7f0c42 upstream. Commit d716ff7 ("tracing: Remove taking of trace_types_lock in pipe files") use the current tracer instead of the copy in tracing_open_pipe(), but it forget to remove the freeing sentence in the error path. There's an error path that can call kfree(iter->trace) after the iter->trace was assigned to tr->current_trace, which would be bad to free. Link: http://lkml.kernel.org/r/[email protected] Cc: [email protected] Fixes: d716ff7 ("tracing: Remove taking of trace_types_lock in pipe files") Signed-off-by: zhangyi (F) <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 286ffaa commit 037a6cf

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

kernel/trace/trace.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5057,7 +5057,6 @@ static int tracing_open_pipe(struct inode *inode, struct file *filp)
50575057
return ret;
50585058

50595059
fail:
5060-
kfree(iter->trace);
50615060
kfree(iter);
50625061
__trace_array_put(tr);
50635062
mutex_unlock(&trace_types_lock);

0 commit comments

Comments
 (0)