Skip to content

Commit

Permalink
tracing: Use free_percpu instead of kfree
Browse files Browse the repository at this point in the history
In the event->profile_enable() failure path, we release the per cpu
buffers using kfree which is wrong because they are per cpu pointers.
Although free_percpu only wraps kfree for now, that may change in the
future so lets use the correct way.

Reported-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Li Zefan <lizf@cn.fujitsu.com>
  • Loading branch information
Frederic Weisbecker committed Oct 5, 2009
1 parent fe8e5b5 commit 75fb409
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/trace/trace_event_profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ static int ftrace_profile_enable_event(struct ftrace_event_call *event)

fail_buf_nmi:
if (!total_profile_count) {
kfree(trace_profile_buf_nmi);
kfree(trace_profile_buf);
free_percpu(trace_profile_buf_nmi);
free_percpu(trace_profile_buf);
trace_profile_buf_nmi = NULL;
trace_profile_buf = NULL;
}
Expand Down

0 comments on commit 75fb409

Please sign in to comment.