summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/exceptions.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/exceptions.c b/tools/testing/selftests/bpf/prog_tests/exceptions.c
index 5663e427dc00..516f4a13013c 100644
--- a/tools/testing/selftests/bpf/prog_tests/exceptions.c
+++ b/tools/testing/selftests/bpf/prog_tests/exceptions.c
@@ -103,9 +103,10 @@ static void test_exceptions_success(void)
goto done; \
} \
if (load_ret != 0) { \
- printf("%s\n", log_buf); \
- if (!ASSERT_OK_PTR(strstr(log_buf, msg), "strstr")) \
+ if (!ASSERT_OK_PTR(strstr(log_buf, msg), "strstr")) { \
+ printf("%s\n", log_buf); \
goto done; \
+ } \
} \
if (!load_ret && attach_err) { \
if (!ASSERT_ERR_PTR(link = bpf_program__attach(prog), "attach err")) \