From: Lorenz Bauer Date: Thu, 13 Apr 2023 09:47:40 +0000 (+0100) Subject: selftests/bpf: Fix use of uninitialized op_name in log tests X-Git-Tag: v6.6.7~2736^2~129^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5a674611d116a5fc28c5429beea2b78c6e2933ef;p=platform%2Fkernel%2Flinux-starfive.git selftests/bpf: Fix use of uninitialized op_name in log tests One of the test assertions uses an uninitialized op_name, which leads to some headscratching if it fails. Use a string constant instead. Fixes: b1a7a480a112 ("selftests/bpf: Add fixed vs rotating verifier log tests") Signed-off-by: Lorenz Bauer Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20230413094740.18041-1-lmb@isovalent.com --- diff --git a/tools/testing/selftests/bpf/prog_tests/verifier_log.c b/tools/testing/selftests/bpf/prog_tests/verifier_log.c index 475092a..8337c6b 100644 --- a/tools/testing/selftests/bpf/prog_tests/verifier_log.c +++ b/tools/testing/selftests/bpf/prog_tests/verifier_log.c @@ -110,7 +110,7 @@ static void verif_log_subtest(const char *name, bool expect_load_error, int log_ } if (!ASSERT_EQ(strlen(logs.buf), 24, "log_fixed_25")) goto cleanup; - if (!ASSERT_STRNEQ(logs.buf, logs.reference, 24, op_name)) + if (!ASSERT_STRNEQ(logs.buf, logs.reference, 24, "log_fixed_contents_25")) goto cleanup; }