diff options
Diffstat (limited to 'tools/perf/util/build-id.c')
-rw-r--r-- | tools/perf/util/build-id.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c index ffdc338df925..a19674666b4e 100644 --- a/tools/perf/util/build-id.c +++ b/tools/perf/util/build-id.c | |||
@@ -61,8 +61,9 @@ static int perf_event__exit_del_thread(struct perf_tool *tool __maybe_unused, | |||
61 | 61 | ||
62 | if (thread) { | 62 | if (thread) { |
63 | rb_erase(&thread->rb_node, &machine->threads); | 63 | rb_erase(&thread->rb_node, &machine->threads); |
64 | machine->last_match = NULL; | 64 | if (machine->last_match == thread) |
65 | thread__delete(thread); | 65 | thread__zput(machine->last_match); |
66 | thread__put(thread); | ||
66 | } | 67 | } |
67 | 68 | ||
68 | return 0; | 69 | return 0; |