summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/util/thread-stack.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/tools/perf/util/thread-stack.c b/tools/perf/util/thread-stack.c
index 61a4286a74dc9..115dc4b27a1bc 100644
--- a/tools/perf/util/thread-stack.c
+++ b/tools/perf/util/thread-stack.c
@@ -593,17 +593,13 @@ int thread_stack__process(struct thread *thread, struct comm *comm,
struct thread_stack *ts = thread->ts;
int err = 0;
- if (ts) {
- if (!ts->crp) {
- /* Supersede thread_stack__event() */
- thread_stack__free(thread);
- thread->ts = thread_stack__new(thread, crp);
- if (!thread->ts)
- return -ENOMEM;
- ts = thread->ts;
- ts->comm = comm;
- }
- } else {
+ if (ts && !ts->crp) {
+ /* Supersede thread_stack__event() */
+ thread_stack__free(thread);
+ ts = NULL;
+ }
+
+ if (!ts) {
thread->ts = thread_stack__new(thread, crp);
if (!thread->ts)
return -ENOMEM;