This is a note to let you know that I've just added the patch titled perf stat: Fix affinity memory leaks on error path to the 6.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: perf-stat-fix-affinity-memory-leaks-on-error-path.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 96f061d992d20e6483c8d2f34e5ac48a187fbf04 Author: Ian Rogers <irogers@xxxxxxxxxx> Date: Mon Sep 30 22:23:24 2024 -0700 perf stat: Fix affinity memory leaks on error path [ Upstream commit 7f6ccb70e465bd8c9cf8973aee1c01224e4bdb3c ] Missed cleanup when an error occurs. Fixes: 49de179577e7 ("perf stat: No need to setup affinities when starting a workload") Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx> Link: https://lore.kernel.org/r/20241001052327.7052-2-irogers@xxxxxxxxxx Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 79e058ff8a33a..b243027bc22d8 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -865,6 +865,7 @@ static int __run_perf_stat(int argc, const char **argv, int run_idx) } } affinity__cleanup(affinity); + affinity = NULL; evlist__for_each_entry(evsel_list, counter) { if (!counter->supported) { @@ -1005,6 +1006,7 @@ static int __run_perf_stat(int argc, const char **argv, int run_idx) if (forks) evlist__cancel_workload(evsel_list); + affinity__cleanup(affinity); return err; }