]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
perf trace: Fix leaks of 'struct thread' in fprintf_sys_enter()
authorNamhyung Kim <namhyung@kernel.org>
Thu, 3 Apr 2025 05:42:13 +0000 (22:42 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 8 May 2025 20:10:09 +0000 (17:10 -0300)
I've found some leaks from 'perf trace -a'.

It seems there are more leaks but this is what I can find for now.

Fixes: 70351029b55677eb ("perf thread: Add support for reading the e_machine type for a thread")
Reviewed-by: Howard Chu <howardchu95@gmail.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250403054213.7021-1-namhyung@kernel.org
[ split from a larget patch ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-trace.c

index c39b7f8ff84627e35231ecd67a13e3eae250cd86..e7d5327123bad6d60fa5ee8a65cc9ccdcc3e0f6d 100644 (file)
@@ -2842,7 +2842,7 @@ static int trace__fprintf_sys_enter(struct trace *trace, struct evsel *evsel,
        e_machine = thread__e_machine(thread, trace->host);
        sc = trace__syscall_info(trace, evsel, e_machine, id);
        if (sc == NULL)
-               return -1;
+               goto out_put;
        ttrace = thread__trace(thread, trace);
        /*
         * We need to get ttrace just to make sure it is there when syscall__scnprintf_args()