diff options
| author | Ian Rogers <irogers@google.com> | 2025-06-24 12:03:22 -0700 |
|---|---|---|
| committer | Namhyung Kim <namhyung@kernel.org> | 2025-07-02 19:05:26 -0700 |
| commit | 7a8557fc4aa12cffc97e5c8a1b8b8fd0275464b2 (patch) | |
| tree | 9c6feb5b5886b4cf71ce2e19383444b85b741de5 /tools/perf/tests/code-reading.c | |
| parent | perf dso: Add missed dso__put to dso__load_kcore (diff) | |
| download | linux-7a8557fc4aa12cffc97e5c8a1b8b8fd0275464b2.tar.gz linux-7a8557fc4aa12cffc97e5c8a1b8b8fd0275464b2.zip | |
perf test code-reading: Avoid a leak of cpus and threads
The perf_evlist__set_maps does the necessary gets on the arguments
passed, so the reference count bumping isn't necessary and creates a
memory leak.
Signed-off-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250624190326.2038704-3-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/perf/tests/code-reading.c')
| -rw-r--r-- | tools/perf/tests/code-reading.c | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c index cf6edbe697b2..6efb6b4bbcce 100644 --- a/tools/perf/tests/code-reading.c +++ b/tools/perf/tests/code-reading.c @@ -749,13 +749,6 @@ static int do_test_code_reading(bool try_kcore) pr_debug("perf_evlist__open() failed!\n%s\n", errbuf); } - /* - * Both cpus and threads are now owned by evlist - * and will be freed by following perf_evlist__set_maps - * call. Getting reference to keep them alive. - */ - perf_cpu_map__get(cpus); - perf_thread_map__get(threads); perf_evlist__set_maps(&evlist->core, NULL, NULL); evlist__delete(evlist); evlist = NULL; |
