Skip to contentSkip to conversation

selftests/bpf: fix use of uninitialized op_name in log tests

PATCH Applied Lorenz Bauer 2 participants 2 messages Apr 13, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 tools/testing/selftests/bpf/prog_tests/verifier_log.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/bpf/prog_tests/verifier_log.c +1 -1
index 475092a78deb..8337c6bc5b95 100644
@@ -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;
 	}
 
Signature · 1 line
2.39.2
#1 lore raw
This patch was applied to bpf/bpf-next.git (master) by Daniel Borkmann <[email protected]>:

Hello:

This patch was applied to bpf/bpf-next.git (master) by Daniel Borkmann <[email protected]>:

Quoted 8 lines · On Thu, 13 Apr 2023 10:47:40 +0100 you wrote:

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")
---
 tools/testing/selftests/bpf/prog_tests/verifier_log.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
- [bpf-next] selftests/bpf: fix use of uninitialized op_name in log tests

    https://git.kernel.org/bpf/bpf-next/c/5a674611d116

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html