summaryrefslogtreecommitdiff
path: root/tools/perf/bench/epoll-ctl.c
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2023-06-12 02:36:08 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2023-06-13 00:18:14 +0300
commite6deda2e5a6a387437bcaeffa7bf4bc95fe8c446 (patch)
tree46eed58475fe6d16ab53b92fc16d05ac9960c906 /tools/perf/bench/epoll-ctl.c
parent0f0d1354a54cf679e773cae551b4523f5ec00c94 (diff)
downloadlinux-e6deda2e5a6a387437bcaeffa7bf4bc95fe8c446.tar.xz
perf bench epoll: Fix missing frees/puts on the exit path
Issues detected by leak sanitizer. Signed-off-by: Ian Rogers <irogers@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: André Almeida <andrealmeid@igalia.com> Cc: Darren Hart <dvhart@infradead.org> Cc: Davidlohr Bueso <dave@stgolabs.net> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20230611233610.953456-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/bench/epoll-ctl.c')
-rw-r--r--tools/perf/bench/epoll-ctl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/perf/bench/epoll-ctl.c b/tools/perf/bench/epoll-ctl.c
index 521d1ff97b06..6bfffe83dde9 100644
--- a/tools/perf/bench/epoll-ctl.c
+++ b/tools/perf/bench/epoll-ctl.c
@@ -421,6 +421,11 @@ int bench_epoll_ctl(int argc, const char **argv)
print_summary();
close(epollfd);
+ perf_cpu_map__put(cpu);
+ for (i = 0; i < nthreads; i++)
+ free(worker[i].fdmap);
+
+ free(worker);
return ret;
errmem:
err(EXIT_FAILURE, "calloc");