diff options
author | Ingo Molnar <mingo@kernel.org> | 2015-04-16 13:38:30 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-04-18 14:31:26 +0300 |
commit | 0c99241c93b8060441f3c8434848e54b5338f922 (patch) | |
tree | 8e1182be161578cf64af32a3a8e91b2b1d17c4aa /tools | |
parent | 78d504bcd769cc496f63b626f507039eab2316b7 (diff) | |
download | linux-0c99241c93b8060441f3c8434848e54b5338f922.tar.xz |
perf/x86/intel/pt: Fix and clean up error handling in pt_event_add()
Dan Carpenter reported that pt_event_add() has buggy
error handling logic: it returns 0 instead of -EBUSY when
it fails to start a newly added event.
Furthermore, the control flow in this function is messy,
with cleanup labels mixed with direct returns.
Fix the bug and clean up the code by converting it to
a straight fast path for the regular non-failing case,
plus a clear sequence of cascading goto labels to do
all cleanup.
NOTE: I materially changed the existing clean up logic in the
pt_event_start() failure case to use the direct
perf_aux_output_end() path, not pt_event_del(), because
perf_aux_output_end() is enough here.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Julia Lawall <julia.lawall@lip6.fr>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20150416103830.GB7847@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions