selftests/bpf: fix error return code in run_getsockopt_test()
Subsystems (5)
PATCH 1/1 selftests/bpf: fix error return code in run_getsockopt_test()
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.
Fixes 65b4414a05eb ("selftests/bpf: add sockopt test that exercises BPF_F_ALLOW_MULTI")
Reported-by Hulk Robot <[email protected]>
Signed-off-by Wang Hai <[email protected]>
--- tools/testing/selftests/bpf/prog_tests/sockopt_multi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/bpf/prog_tests/sockopt_multi.c +2 -1
@@ -138,7 +138,8 @@ static int run_getsockopt_test(struct bpf_object *obj, int cg_parent,*/ buf =0x40 ; -if (setsockopt (sock_fd,SOL_IP ,IP_TOS , &buf,1 ) <0 ) { + err =setsockopt (sock_fd,SOL_IP ,IP_TOS , &buf,1 ); +if (err <0 ) {log_err ("Failed to call setsockopt(IP_TOS)" ); goto detach; }
Signature · 1 line
2.17.1
This patch was applied to bpf/bpf.git (refs/heads/master):
Hello:
This patch was applied to bpf/bpf.git (refs/heads/master):
Quoted 8 lines · On Mon, 16 Nov 2020 18:16:33 +0800 you wrote:
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.
Fixes 65b4414a05eb ("selftests/bpf: add sockopt test that exercises BPF_F_ALLOW_MULTI")Reported-by Hulk Robot <[email protected]>Signed-off-by Wang Hai <[email protected]>[...]
Here is the summary with links:
- [bpf] selftests/bpf: fix error return code in run_getsockopt_test()
https://git.kernel.org/bpf/bpf/c/2acc3c1bc8e9
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html