tracing: Fix memory leak on instance deletion
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>
Sat, 7 Jun 2014 03:17:28 +0000 (23:17 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Sat, 7 Jun 2014 03:17:28 +0000 (23:17 -0400)
When an instance is created, it also gets a snapshot ring buffer
allocated (with minimum of pages). But when it is deleted the snapshot
buffer is not. There was a helper function added to match the allocation
of these ring buffers to a way to free them, but it wasn't used by
the deletion of an instance. Using that helper function solves this
memory leak.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/trace.c

index 26cfff3..16f7038 100644 (file)
@@ -6349,8 +6349,7 @@ static int instance_delete(const char *name)
        event_trace_del_tracer(tr);
        ftrace_destroy_function_files(tr);
        debugfs_remove_recursive(tr->dir);
-       free_percpu(tr->trace_buffer.data);
-       ring_buffer_free(tr->trace_buffer.buffer);
+       free_trace_buffers(tr);
 
        kfree(tr->name);
        kfree(tr);