diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-10-13 09:31:28 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-10-13 09:31:34 +0200 |
commit | 9dbdd6c41c12fb42ee7188eafa7e1917b192af3a (patch) | |
tree | 06a9eb894bc976c5c20e84ccd74fd82b9b71aed4 /kernel/trace/trace_event_profile.c | |
parent | 7a693d3f0d10f978ebdf3082c41404ab97106567 (diff) | |
parent | 161291396e76e0832c08f617eb9bd364d1648148 (diff) |
Merge commit 'v2.6.32-rc4' into perf/core
Merge reason: we were on an -rc1 base, merge up to -rc4.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/trace_event_profile.c')
-rw-r--r-- | kernel/trace/trace_event_profile.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/kernel/trace/trace_event_profile.c b/kernel/trace/trace_event_profile.c index dd44b876886..8d5c171cc99 100644 --- a/kernel/trace/trace_event_profile.c +++ b/kernel/trace/trace_event_profile.c @@ -31,7 +31,7 @@ static int ftrace_profile_enable_event(struct ftrace_event_call *event) if (atomic_inc_return(&event->profile_count)) return 0; - if (!total_profile_count++) { + if (!total_profile_count) { buf = (char *)alloc_percpu(profile_buf_t); if (!buf) goto fail_buf; @@ -46,14 +46,19 @@ static int ftrace_profile_enable_event(struct ftrace_event_call *event) } ret = event->profile_enable(); - if (!ret) + if (!ret) { + total_profile_count++; return 0; + } - kfree(trace_profile_buf_nmi); fail_buf_nmi: - kfree(trace_profile_buf); + if (!total_profile_count) { + free_percpu(trace_profile_buf_nmi); + free_percpu(trace_profile_buf); + trace_profile_buf_nmi = NULL; + trace_profile_buf = NULL; + } fail_buf: - total_profile_count--; atomic_dec(&event->profile_count); return ret; |