mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
perf session: Invalidate last_match when removing threads from rb_tree
If we receive two PERF_RECORD_EXIT for the same thread, we can end up reusing session->last_match and trying to remove the thread twice from the rb_tree, causing a segfault, so invalidade last_match in perf_session__remove_thread. Receiving two PERF_RECORD_EXIT for the same thread is a bug, but its a harmless one if we make the tool more robust, like this patch does. Cc: Frederic Weisbecker <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
This commit is contained in:
parent
076c6e4521
commit
70597f21f1
1 changed files with 1 additions and 0 deletions
|
|
@ -166,6 +166,7 @@ void perf_session__delete(struct perf_session *self)
|
|||
|
||||
void perf_session__remove_thread(struct perf_session *self, struct thread *th)
|
||||
{
|
||||
self->last_match = NULL;
|
||||
rb_erase(&th->rb_node, &self->threads);
|
||||
/*
|
||||
* We may have references to this thread, for instance in some hist_entry
|
||||
|
|
|
|||
Loading…
Reference in a new issue