]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
perf sched: Free thread->priv using priv_destructor
authorNamhyung Kim <namhyung@kernel.org>
Thu, 3 Jul 2025 01:49:36 +0000 (18:49 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Aug 2025 10:08:53 +0000 (12:08 +0200)
commit16ce5ce11145e42e89dbcf68a5c56466f163ffde
treeaf65f371a3c2897257aca5fcf008625916cb3cfb
parente5de9ea7796e79f3cd082624f788cc3442bff2a8
perf sched: Free thread->priv using priv_destructor

[ Upstream commit aa9fdd106bab8c478d37eba5703c0950ad5c0d4f ]

In many perf sched subcommand saves priv data structure in the thread
but it forgot to free them.  As it's an opaque type with 'void *', it
needs to register that knows how to free the data.  In this case, just
regular 'free()' is fine.

Fixes: 04cb4fc4d40a5bf1 ("perf thread: Allow tools to register a thread->priv destructor")
Reviewed-by: Ian Rogers <irogers@google.com>
Tested-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250703014942.1369397-3-namhyung@kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/perf/builtin-sched.c