mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-23 10:57:35 -04:00
If run() exits early via SCX_EQ/SCX_ASSERT (which calls return directly), bpf_link__destroy() is never reached and the BPF scheduler stays loaded. All subsequent tests then fail to attach because SCX is not in the DISABLED state. Move bpf_link into a context struct so cleanup() always destroys it, regardless of how run() exits. Also skip waitpid() for children where fork() returned -1, avoiding waitpid(-1,...) accidentally reaping an unrelated child and triggering the early return path. Signed-off-by: Cheng-Yang Chou <yphbchou0911@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org> Reviewed-by: Andrea Righi <arighi@nvidia.com>