summaryrefslogtreecommitdiffstats
path: root/tools/perf/tests/topology.c
diff options
context:
space:
mode:
authorRiccardo Mancini <rickyman7@gmail.com>2021-07-15 18:07:08 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2021-07-15 22:27:51 +0200
commit233f2dc1c284337286f9a64c0152236779a42f6c (patch)
tree1793cf66ebbd8eeb5d6639a1f9d1c76bcaa1fdb1 /tools/perf/tests/topology.c
parentperf env: Fix sibling_dies memory leak (diff)
downloadlinux-233f2dc1c284337286f9a64c0152236779a42f6c.tar.xz
linux-233f2dc1c284337286f9a64c0152236779a42f6c.zip
perf test session_topology: Delete session->evlist
ASan reports a memory leak related to session->evlist while running: # perf test "41: Session topology". When perf_data is in write mode, session->evlist is owned by the caller, which should also take care of deleting it. This patch adds the missing evlist__delete(). Signed-off-by: Riccardo Mancini <rickyman7@gmail.com> Fixes: c84974ed9fb67293 ("perf test: Add entry to test cpu topology") Cc: Ian Rogers <irogers@google.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Kan Liang <kan.liang@intel.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lore.kernel.org/lkml/822f741f06eb25250fb60686cf30a35f447e9e91.1626343282.git.rickyman7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/tests/topology.c')
-rw-r--r--tools/perf/tests/topology.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/perf/tests/topology.c b/tools/perf/tests/topology.c
index ec4e3b21b831..b5efe675b321 100644
--- a/tools/perf/tests/topology.c
+++ b/tools/perf/tests/topology.c
@@ -61,6 +61,7 @@ static int session_write_header(char *path)
TEST_ASSERT_VAL("failed to write header",
!perf_session__write_header(session, session->evlist, data.file.fd, true));
+ evlist__delete(session->evlist);
perf_session__delete(session);
return 0;