Commit 9a35bd9e authored by Pu Lehui's avatar Pu Lehui
Browse files

Revert "[Backport] selftests/bpf: adjust dummy_st_ops_success to detect additional error"

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IAIM4R



--------------------------------

This reverts commit a45f1a4fb1deb1b1007cf5768debb0806cc91f8b.

This patch depends on commit 1479eaff1f16 ("bpf: mark
bpf_dummy_struct_ops.test_1 parameter as nullable"),
but the commit is not currently merged.

Fixes: 465e9f1d ("selftests/bpf: adjust dummy_st_ops_success to detect additional error")
Signed-off-by: default avatarPu Lehui <pulehui@huawei.com>
parent b308873a
Loading
Loading
Loading
Loading
+2 −11
Original line number Diff line number Diff line
@@ -11,17 +11,8 @@ int BPF_PROG(test_1, struct bpf_dummy_ops_state *state)
{
	int ret;

	/* Check that 'state' nullable status is detected correctly.
	 * If 'state' argument would be assumed non-null by verifier
	 * the code below would be deleted as dead (which it shouldn't).
	 * Hide it from the compiler behind 'asm' block to avoid
	 * unnecessary optimizations.
	 */
	asm volatile (
		"if %[state] != 0 goto +2;"
		"r0 = 0xf2f3f4f5;"
		"exit;"
	::[state]"p"(state));
	if (!state)
		return 0xf2f3f4f5;

	ret = state->val;
	state->val = 0x5a;