mm/damon/sysfs-schemes: call missing mem_cgroup_iter_break()
Subsystems (3)
SeongJae Park
maintainerRFC PATCH 1/1 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.
[1] https://lore.kernel.org/[email protected]
Fixes 29cbb9a13f05 ("mm/damon/sysfs-schemes: implement scheme filters")
Cc <[email protected]> # 6.3.x
Signed-off-by SeongJae Park <[email protected]>
--- mm/damon/sysfs-schemes.c | 1 + 1 file changed, 1 insertion(+)
mm/damon/sysfs-schemes.c +1 -0
@@ -2594,6 +2594,7 @@ static int damon_sysfs_memcg_path_to_id(char *memcg_path, u64 *id)if (damon_sysfs_memcg_path_eq (memcg, path, memcg_path)) { *id =mem_cgroup_id (memcg); found = true; +mem_cgroup_iter_break (NULL , memcg);break ; } }
base-commit: 8aa462c5a7540f9f8882cf8fa6add712fdf38c91
Signature · 1 line
2.47.3