]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mm/damon/core: fix potential memory leak by cleaning ops_filter in damon_destroy_scheme
authorEnze Li <lienze@kylinos.cn>
Tue, 14 Oct 2025 08:42:25 +0000 (16:42 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 21 Oct 2025 22:46:17 +0000 (15:46 -0700)
commit7071537159be845a5c4ed5fb7d3db25aa4bd04a3
tree0bdc8f7cdc1918bf9f4f63f864bdde7236fc31fa
parentcec944dd329fbefee907da95c298719d900d4787
mm/damon/core: fix potential memory leak by cleaning ops_filter in damon_destroy_scheme

Currently, damon_destroy_scheme() only cleans up the filter list but
leaves ops_filter untouched, which could lead to memory leaks when a
scheme is destroyed.

This patch ensures both filter and ops_filter are properly freed in
damon_destroy_scheme(), preventing potential memory leaks.

Link: https://lkml.kernel.org/r/20251014084225.313313-1-lienze@kylinos.cn
Fixes: ab82e57981d0 ("mm/damon/core: introduce damos->ops_filters")
Signed-off-by: Enze Li <lienze@kylinos.cn>
Reviewed-by: SeongJae Park <sj@kernel.org>
Tested-by: SeongJae Park <sj@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/damon/core.c