Skip to content

Commit 2c9ee74

Browse files
committed
tracing: Free module_delta on freeing of persistent ring buffer
If a persistent ring buffer is created, a "module_delta" array is also allocated to hold the module deltas of loaded modules that match modules in the scratch area. If this buffer gets freed, the module_delta array is not freed and causes a memory leak. Cc: Masami Hiramatsu <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Link: https://lore.kernel.org/[email protected] Fixes: 35a380d ("tracing: Show last module text symbols in the stacktrace") Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent b81ff11 commit 2c9ee74

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kernel/trace/trace.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9609,6 +9609,7 @@ static void free_trace_buffers(struct trace_array *tr)
96099609
return;
96109610

96119611
free_trace_buffer(&tr->array_buffer);
9612+
kfree(tr->module_delta);
96129613

96139614
#ifdef CONFIG_TRACER_MAX_TRACE
96149615
free_trace_buffer(&tr->max_buffer);

0 commit comments

Comments
 (0)