perf trace: Add missing thread__put() in thread__e_machine()
authorIan Rogers <irogers@google.com>
Tue, 1 Apr 2025 20:27:15 +0000 (13:27 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 8 May 2025 14:50:44 +0000 (11:50 -0300)
Add missing thread__put() of the found parent thread in
thread__e_machine().

Reviewed-by: Howard Chu <howardchu95@gmail.com>
Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250401202715.3493567-1-irogers@google.com
[ split from a larger patch ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/thread.c

index 89585f53c1d5ccf6cdb457f65d4e8e1d39280738..415c0e5d1e751a47b16ae0b622aae2e0bac1f362 100644 (file)
@@ -471,6 +471,7 @@ uint16_t thread__e_machine(struct thread *thread, struct machine *machine)
 
                if (parent) {
                        e_machine = thread__e_machine(parent, machine);
+                       thread__put(parent);
                        thread__set_e_machine(thread, e_machine);
                        return e_machine;
                }