Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf ordered_events: Fix crash in ordered_events__free
Song Liu reported crash in 'perf record': > #0 0x0000000000500055 in ordered_events(float, long double,...)(...) () > rib#1 0x0000000000500196 in ordered_events.reinit () > rib#2 0x00000000004fe413 in perf_session.process_events () > rib#3 0x0000000000440431 in cmd_record () > rib#4 0x00000000004a439f in run_builtin () > rib#5 0x000000000042b3e5 in main ()" This can happen when we get out of buffers during event processing. The subsequent ordered_events__free() call assumes oe->buffer != NULL and crashes. Add a check to prevent that. Reported-by: Song Liu <[email protected]> Signed-off-by: Jiri Olsa <[email protected]> Reviewed-by: Song Liu <[email protected]> Tested-by: Song Liu <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Fixes: d5ceb62 ("perf ordered_events: Add 'struct ordered_events_buffer' layer") Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
- Loading branch information