mirror-linux/tools/testing/selftests/cgroup
Yu Miao 7d8f3158a5 selftests/cgroup: Fix error path leaks in test_percpu_basic
When cg_name_indexed() returns NULL partway through the child creation
loop, the code returned -1 without running cleanup_children and cleanup.
That left the `parent` pathname allocation unreleased and did not remove
child cgroup directories already created under the parent. Fix by jumping
to cleanup_children instead of returning.

When cg_create() fails, `child` (the pathname from cg_name_indexed())
was not freed before cleanup_children. Fix by freeing `child` before
branching to cleanup_children.

Fixes: 90631e1dea ("kselftests: cgroup: add perpcu memory accounting test")
Signed-off-by: Yu Miao <yumiao@kylinos.cn>
Signed-off-by: Tejun Heo <tj@kernel.org>
2026-05-13 08:40:52 -10:00
..
lib selftests/cgroup: Fix cg_read_strcmp() empty string comparison 2026-05-10 15:53:44 -10:00
.gitignore selftests: cgroup: Add basic tests for pids controller 2024-05-26 08:45:10 -10:00
Makefile cgroup: selftests: Move cgroup_util into its own library 2025-05-16 11:45:15 -07:00
config mm: remove CONFIG_MEMCG_KMEM 2024-07-10 12:14:54 -07:00
memcg_protection.m selftests: memcg: adjust expected reclaim values of protected cgroups 2022-05-27 09:33:45 -07:00
test_core.c selftests/cgroup: Don't require synchronous populated update on task exit 2026-03-24 10:21:57 -10:00
test_cpu.c Significant patch series in this pull request: 2025-12-06 14:01:20 -08:00
test_cpuset.c Significant patch series in this pull request: 2025-12-06 14:01:20 -08:00
test_cpuset_prs.sh cgroup/cpuset: Defer housekeeping_update() calls from CPU hotplug to workqueue 2026-02-23 10:42:11 -10:00
test_cpuset_v1_base.sh selftests/cgroup: Fix string comparison in write_test 2026-05-10 15:54:12 -10:00
test_cpuset_v1_hp.sh selftests/cgroup: use bash in test_cpuset_v1_hp.sh 2025-02-04 09:36:54 -10:00
test_freezer.c Significant patch series in this pull request: 2025-12-06 14:01:20 -08:00
test_hugetlb_memcg.c selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
test_kill.c selftests/cgroup: Don't require synchronous populated update on task exit 2026-03-24 10:21:57 -10:00
test_kmem.c selftests/cgroup: Fix error path leaks in test_percpu_basic 2026-05-13 08:40:52 -10:00
test_memcontrol.c mm.git review status for linus..mm-stable 2026-04-15 12:59:16 -07:00
test_pids.c selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
test_stress.sh kseltest/cgroup: Make test_stress.sh work if run interactively 2022-05-13 09:33:21 -10:00
test_zswap.c selftests/cgroup: add test for zswap incompressible pages 2026-04-05 13:53:00 -07:00
wait_inotify.c kselftest/cgroup: Add cpuset v2 partition root state test 2022-09-04 10:47:28 -10:00
with_stress.sh selftests: cgroup: Run test_core under interfering stress 2019-10-07 07:11:54 -07:00