The quilt patch titled Subject: mm/damon/sysfs-schemes: Fix leaking a filter for wrong cgroup path has been removed from the -mm tree. Its filename was mm-damon-sysfs-schemes-implement-scheme-filters-fix.patch This patch was dropped because it was folded into mm-damon-sysfs-schemes-implement-scheme-filters.patch ------------------------------------------------------ From: SeongJae Park <sj@xxxxxxxxxx> Subject: mm/damon/sysfs-schemes: Fix leaking a filter for wrong cgroup path Date: Mon, 19 Dec 2022 17:18:06 +0000 Commit f36f860207efa ("mm/damon/sysfs-schemes: implement scheme filters") on mm-unstable introduced 'damon_syfs_set_scheme_filters()', which does not free newly allocated filter when it fails setting memcg id for the filter. As a result, the memory for the filter leaks. Fix it by freeing the filter before returning the error. Coverity CID: 1530032 Link: https://lkml.kernel.org/r/20221219171807.55708-2-sj@xxxxxxxxxx Fixes: f36f860207ef ("mm/damon/sysfs-schemes: implement scheme filters") on mm-unstable Signed-off-by: SeongJae Park <sj@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- --- a/mm/damon/sysfs-schemes.c~mm-damon-sysfs-schemes-implement-scheme-filters-fix +++ a/mm/damon/sysfs-schemes.c @@ -1464,8 +1464,10 @@ static int damon_sysfs_set_scheme_filter err = damon_sysfs_memcg_path_to_id( sysfs_filter->memcg_path, &filter->memcg_id); - if (err) + if (err) { + damos_destroy_filter(filter); return err; + } } damos_add_filter(scheme, filter); } _ Patches currently in -mm which might be from sj@xxxxxxxxxx are mm-damon-core-implement-damos-filter.patch mm-damon-paddr-support-damos-filters.patch mm-damon-reclaim-add-a-parameter-called-skip_anon-for-avoiding-anonymous-pages-reclamation.patch docs-admin-guide-damon-reclaim-document-skip_anon-parameter.patch mm-damon-sysfs-schemes-implement-filters-directory.patch mm-damon-sysfs-schemes-implement-filter-directory.patch mm-damon-sysfs-schemes-connect-filter-directory-and-filters-directory.patch mm-damon-sysfs-schemes-implement-scheme-filters.patch mm-damon-sysfs-schemes-implement-scheme-filters-fix-fix-2.patch selftests-damon-sysfs-test-filters-directory.patch docs-admin-guide-mm-damon-usage-document-damos-filters-of-sysfs.patch docs-abi-damon-document-scheme-filters-files.patch mm-page_reporting-replace-rcu_access_pointer-with-rcu_dereference_protected.patch maintainers-add-types-to-akpm-mm-git-trees-entries.patch maintainers-memory-management-add-tools-vm-as-managed-files.patch tools-vm-rename-tools-vm-to-tools-mm.patch selftests-vm-rename-selftets-vm-to-selftests-mm.patch selftests-vm-rename-selftets-vm-to-selftests-mm-fix.patch docs-admin-guide-mm-numaperf-increase-depth-of-subsections.patch docs-admin-guide-mm-numaperf-increase-depth-of-subsections-fix.patch mm-damon-vaddr-rename-damon_young_walk_private-page_sz-to-folio_sz.patch mm-damon-vaddr-support-folio-of-neither-hpage_pmd_size-nor-page_size.patch mm-damon-vaddr-record-appropriate-folio-size-when-the-access-is-not-found.patch mm-damon-paddr-rename-damon_pa_access_chk_result-page_sz-to-folio_sz.patch mm-damon-paddr-remove-folio_sz-field-from-damon_pa_access_chk_result.patch mm-damon-paddr-remove-damon_pa_access_chk_result-struct.patch mm-damon-core-update-kernel-doc-comments-for-damos-action-supports-of-each-damon-operations-set.patch mm-damon-core-update-kernel-doc-comments-for-damos-filters-supports-of-each-damon-operations-set.patch docs-mm-damon-index-mention-damos-on-the-intro.patch docs-admin-guide-mm-damon-usage-update-damos-actions-filters-supports-of-each-damon-operations-set.patch docs-mm-damon-add-a-maintainer-profile-for-damon.patch maintainers-damon-link-maintainer-profile-git-trees-and-website.patch selftests-damon-sysfs-hide-expected-write-failures.patch selftests-damon-debugfs_rm_non_contexts-hide-expected-write-error-messages.patch scripts-spelling-add-a-few-more-typos.patch