summaryrefslogtreecommitdiff
path: root/tools/testing/selftests
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2026-09-26 13:38:35 +0200
committerKumar Kartikeya Dwivedi <memxor@gmail.com>2026-09-26 14:38:15 +0200
commitea9358e1270ab2c3ba6f36bd9bdda68617665516 (patch)
tree9951522ade90eb3241dc5fb780fe9ef8c0a4bb12 /tools/testing/selftests
parent12aa64bbce1247d24f410843e2b71dbc8316e3e7 (diff)
downloadlinux-next-ea9358e1270ab2c3ba6f36bd9bdda68617665516.tar.gz
linux-next-ea9358e1270ab2c3ba6f36bd9bdda68617665516.zip
selftests/bpf: Fix gcc -Wreturn-type error in the tail call subprog test
gcc's C front end warns for a static function returning non-void that has no return statement at all, regardless of the for (;;) {} it ends in, and BPF CI builds test_progs-bpf_gcc with -Werror: progs/verifier_cfg.c: In function 'tail_call_or_throw_subprog': error: no return statement in function returning non-void [-Werror=return-type] Add an unreachable return after the loop. # LDLIBS=-static PKG_CONFIG='pkg-config --static' ./vmtest.sh -- ./test_progs -t verifier_cfg [...] #626/21 verifier_cfg/tail call in a subprogram without an exit:OK #626 verifier_cfg:OK Summary: 1/21 PASSED, 0 SKIPPED, 0/0 FAILED Fixes: 5add2c64f474 ("selftests/bpf: Add a test for a tail call in a subprogram without an exit") Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/r/20260926113835.1193471-1-daniel@iogearbox.net Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Diffstat (limited to 'tools/testing/selftests')
-rw-r--r--tools/testing/selftests/bpf/progs/verifier_cfg.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/progs/verifier_cfg.c b/tools/testing/selftests/bpf/progs/verifier_cfg.c
index 07388a922e5b..6379dfc9389b 100644
--- a/tools/testing/selftests/bpf/progs/verifier_cfg.c
+++ b/tools/testing/selftests/bpf/progs/verifier_cfg.c
@@ -196,6 +196,7 @@ static int tail_call_or_throw_subprog(void *ctx)
bpf_tail_call(ctx, &map_array, idx);
bpf_throw(0);
for (;;) {}
+ return 0;
}
SEC("tc")