perf evlist: Add success path to evlist__create_syswide_maps
[ Upstream commitfe0ce8a9d8] Over various refactorings evlist__create_syswide_maps has been made to only ever return with -ENOMEM. Fix this so that when perf_evlist__set_maps is successfully called, 0 is returned. Reviewed-by: Howard Chu <howardchu95@gmail.com> Signed-off-by: Ian Rogers <irogers@google.com> Reviewed-by: Arnaldo Carvalho de Melo <acme@redhat.com> Link: https://lore.kernel.org/r/20250228222308.626803-3-irogers@google.com Fixes:8c0498b689("perf evlist: Fix create_syswide_maps() not propagating maps") Signed-off-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
1f562f8efa
commit
8a832ed0f6
@@ -1362,19 +1362,18 @@ static int evlist__create_syswide_maps(struct evlist *evlist)
|
||||
*/
|
||||
cpus = perf_cpu_map__new(NULL);
|
||||
if (!cpus)
|
||||
goto out;
|
||||
return -ENOMEM;
|
||||
|
||||
threads = perf_thread_map__new_dummy();
|
||||
if (!threads)
|
||||
goto out_put;
|
||||
if (!threads) {
|
||||
perf_cpu_map__put(cpus);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
perf_evlist__set_maps(&evlist->core, cpus, threads);
|
||||
|
||||
perf_thread_map__put(threads);
|
||||
out_put:
|
||||
perf_cpu_map__put(cpus);
|
||||
out:
|
||||
return -ENOMEM;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int evlist__open(struct evlist *evlist)
|
||||
|
||||
Reference in New Issue
Block a user