Skip to content

Commit d4e7b5c

Browse files
sjp38akpm00
authored andcommitted
mm/damon/sysfs-schemes: call missing mem_cgroup_iter_break()
damon_sysfs_memcg_path_to_id() breaks mem_cgroup_iter() loop without calling mem_cgroup_iter_break(). This leaks the cgroup reference. Fix the issue by calling mem_cgroup_iter_break() before the break. The issue was discovered [1] by Sashiko. Link: https://lore.kernel.org/20260426173625.86521-1-sj@kernel.org Link: https://lore.kernel.org/20260423004148.74722-1-sj@kernel.org [1] Fixes: 29cbb9a ("mm/damon/sysfs-schemes: implement scheme filters") Signed-off-by: SeongJae Park <sj@kernel.org> Cc: <stable@vger.kernel.org> # 6.3.x Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 63451de commit d4e7b5c

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

mm/damon/sysfs-schemes.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2594,6 +2594,7 @@ static int damon_sysfs_memcg_path_to_id(char *memcg_path, u64 *id)
25942594
if (damon_sysfs_memcg_path_eq(memcg, path, memcg_path)) {
25952595
*id = mem_cgroup_id(memcg);
25962596
found = true;
2597+
mem_cgroup_iter_break(NULL, memcg);
25972598
break;
25982599
}
25992600
}

0 commit comments

Comments
 (0)