mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-10 20:09:56 +00:00
perf stat: Fix affinity memory leaks on error path
Missed cleanup when an error occurs.
Fixes: 49de179577 ("perf stat: No need to setup affinities when starting a workload")
Signed-off-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20241001052327.7052-2-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
This commit is contained in:
@@ -827,6 +827,7 @@ try_again_reset:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
affinity__cleanup(affinity);
|
affinity__cleanup(affinity);
|
||||||
|
affinity = NULL;
|
||||||
|
|
||||||
evlist__for_each_entry(evsel_list, counter) {
|
evlist__for_each_entry(evsel_list, counter) {
|
||||||
if (!counter->supported) {
|
if (!counter->supported) {
|
||||||
@@ -965,6 +966,7 @@ err_out:
|
|||||||
if (forks)
|
if (forks)
|
||||||
evlist__cancel_workload(evsel_list);
|
evlist__cancel_workload(evsel_list);
|
||||||
|
|
||||||
|
affinity__cleanup(affinity);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user