Skip to content

Commit 86ce322

Browse files
anakryikoborkmann
authored andcommitted
selftests/bpf: Don't exit on failed bpf_testmod unload
Fix bug in handling bpf_testmod unloading that will cause test_progs exiting prematurely if bpf_testmod unloading failed. This is especially problematic when running a subset of test_progs that doesn't require root permissions and doesn't rely on bpf_testmod, yet will fail immediately due to exit(1) in unload_bpf_testmod(). Fixes: 9f7fa22 ("selftests/bpf: Add bpf_testmod kernel module for testing") Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/bpf/20210126065019.1268027-1-andrii@kernel.org
1 parent 190d1c9 commit 86ce322

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/bpf/test_progs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ static void unload_bpf_testmod(void)
390390
return;
391391
}
392392
fprintf(env.stderr, "Failed to unload bpf_testmod.ko from kernel: %d\n", -errno);
393-
exit(1);
393+
return;
394394
}
395395
if (env.verbosity > VERBOSE_NONE)
396396
fprintf(stdout, "Successfully unloaded bpf_testmod.ko.\n");

0 commit comments

Comments
 (0)