]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/cgroup: fix child process escaping to parent cleanup in test_cpucg_nice
authorTao Cui <cuitao@kylinos.cn>
Mon, 11 May 2026 06:15:08 +0000 (14:15 +0800)
committerTejun Heo <tj@kernel.org>
Mon, 11 May 2026 08:29:06 +0000 (22:29 -1000)
commit5b72759aa0c9fb6fb44da0d62ef749bfaed868dc
tree9f5e21d5f7b22500e1c687a41f572ded122d33e5
parentc26849d32167ec4f2051bb8c9798e850f6381ac9
selftests/cgroup: fix child process escaping to parent cleanup in test_cpucg_nice

In test_cpucg_nice, the forked child process incorrectly jumps to the
parent's cleanup label on cg_write failure. This causes the child to
attempt cg_destroy on cgroups the parent is still using, and then
return to main() to continue executing tests as if it were the parent.

Replace goto cleanup with exit(EXIT_FAILURE) in the child process.

Signed-off-by: Tao Cui <cuitao@kylinos.cn>
Signed-off-by: Tejun Heo <tj@kernel.org>
tools/testing/selftests/cgroup/test_cpu.c