mirror-linux/tools
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
..
accounting tools/accounting: handle truncated taskstats netlink messages 2026-04-15 02:15:02 -07:00
arch Arm: 2026-04-17 07:18:03 -07:00
bootconfig
bpf bpftool: add missing fsession to the usage and docs of bpftool 2026-04-12 12:42:38 -07:00
build RTLA patches for v7.1: 2026-04-15 17:48:24 -07:00
certs
cgroup
counter
crypto
debugging
dma
docs
firewire
firmware
gpio
hv
iio
include Arm: 2026-04-17 07:18:03 -07:00
kvm/kvm_stat
laptop
leds
lib mm.git review status for linus..mm-stable 2026-04-15 12:59:16 -07:00
memory-model
mm
net tools: ynl: add sample for wireguard 2026-04-14 11:48:04 -07:00
objtool objtool updates for v7.1: 2026-04-14 13:00:04 -07:00
pcmcia
perf RISC-V updates for v7.0-rc8 2026-04-10 17:27:08 -07:00
power Power management updates for 7.1-rc1 2026-04-13 19:47:52 -07:00
rcu
sched
sched_ext tools/sched_ext: Add explicit cast from void* in RESIZE_ARRAY() 2026-04-13 06:14:11 -10:00
scripts Kbuild/Kconfig updates for 7.1 2026-04-14 09:18:40 -07:00
sound
spi
testing selftests/cgroup: Fix error path leaks in test_percpu_basic 2026-05-13 08:40:52 -10:00
thermal
time
tracing RTLA patches for v7.1: 2026-04-15 17:48:24 -07:00
unittests
usb
verification
virtio
wmi
workqueue
writeback
Makefile