diff options
| author | Ian Rogers <irogers@google.com> | 2025-11-22 00:19:19 -0800 |
|---|---|---|
| committer | Namhyung Kim <namhyung@kernel.org> | 2025-12-03 11:07:46 -0800 |
| commit | 69d247295a51db53294efc14dc7e73b3c57df0f8 (patch) | |
| tree | 70fc62010c973c86ad9fd2716826bda87bdfe31e /tools/perf | |
| parent | f60efb4454b24cc944ff3eac164bb9dce9169f71 (diff) | |
perf mem-events: Don't leak online CPU map
Reference count checking found the online CPU map was being gotten but
not put. Add in the missing put.
Signed-off-by: Ian Rogers <irogers@google.com>
Reviewed-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/perf')
| -rw-r--r-- | tools/perf/util/mem-events.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/perf/util/mem-events.c b/tools/perf/util/mem-events.c index 80b3069427bc..0b49fce251fc 100644 --- a/tools/perf/util/mem-events.c +++ b/tools/perf/util/mem-events.c @@ -303,12 +303,15 @@ int perf_mem_events__record_args(const char **rec_argv, int *argv_nr, char **eve } if (cpu_map) { - if (!perf_cpu_map__equal(cpu_map, cpu_map__online())) { + struct perf_cpu_map *online = cpu_map__online(); + + if (!perf_cpu_map__equal(cpu_map, online)) { char buf[200]; cpu_map__snprint(cpu_map, buf, sizeof(buf)); pr_warning("Memory events are enabled on a subset of CPUs: %s\n", buf); } + perf_cpu_map__put(online); perf_cpu_map__put(cpu_map); } |
