Skip to content

Commit

Permalink
perf: Don't call release_callchain_buffers() if allocation fails
Browse files Browse the repository at this point in the history
When alloc_callchain_buffers() fails, it frees all of
entries before return. In addition, calling the
release_callchain_buffers() will cause a NULL pointer
dereference since callchain_cpu_entries is not set.

Signed-off-by: Namhyung Kim <[email protected]>
Acked-by: Frederic Weisbecker <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
Namhyung Kim authored and Ingo Molnar committed Jan 21, 2012
1 parent dcd6c92 commit fd45c15
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions kernel/events/callchain.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ int get_callchain_buffers(void)
}

err = alloc_callchain_buffers();
if (err)
release_callchain_buffers();
exit:
mutex_unlock(&callchain_mutex);

Expand Down

0 comments on commit fd45c15

Please sign in to comment.