mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 02:53:36 +02:00
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>
This commit is contained in:
parent
f60efb4454
commit
69d247295a
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user