summaryrefslogtreecommitdiff
path: root/kernel/events/callchain.c
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2013-07-23 04:30:59 +0400
committerIngo Molnar <mingo@kernel.org>2013-07-31 00:22:58 +0400
commit6050cb0b0b366092d1383bc23d7b16cd26db00f0 (patch)
treee29edecc20a04e17aa4c7f83d21a140d3e377356 /kernel/events/callchain.c
parent7d9ffa8961482232d964173cccba6e14d2d543b2 (diff)
downloadlinux-6050cb0b0b366092d1383bc23d7b16cd26db00f0.tar.xz
perf: Fix branch stack refcount leak on callchain init failure
On callchain buffers allocation failure, free_event() is called and all the accounting performed in perf_event_alloc() for that event is cancelled. But if the event has branch stack sampling, it is unaccounted as well from the branch stack sampling events refcounts. This is a bug because this accounting is performed after the callchain buffer allocation. As a result, the branch stack sampling events refcount can become negative. To fix this, move the branch stack event accounting before the callchain buffer allocation. Reported-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Stephane Eranian <eranian@google.com> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1374539466-4799-2-git-send-email-fweisbec@gmail.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/events/callchain.c')
0 files changed, 0 insertions, 0 deletions