mm/damon/sysfs-schemes: call missing mem_cgroup_iter_break()
Subsystems (3)
SeongJae Park
maintainerPATCH 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]>
---
Changes from RFC
- rfc: https://lore.kernel.org/[email protected]
- Rebase to latest mm-new.
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: 63037c6230622d20536f4327a162b82cd59fb483
Signature · 1 line
2.47.3