]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Fix few more compiler warnings
authorAndrii Nakryiko <andrii@kernel.org>
Tue, 5 Jul 2022 22:48:17 +0000 (15:48 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 6 Jul 2022 14:46:14 +0000 (16:46 +0200)
commitea4af94afafa4c7314c2b00672e11ea1ba9b612b
tree3f9d9fc7c447eb0329273f9278a54f88c075d8c2
parent082a4062057782b564084b96d75dfd8765926000
selftests/bpf: Fix few more compiler warnings

When compiling with -O2, GCC detects few problems with selftests/bpf, so
fix all of them. Two are real issues (uninitialized err and nums
out-of-bounds access), but two other uninitialized variables warnings
are due to GCC not being able to prove that variables are indeed
initialized under conditions under which they are used.

Fix all 4 cases, though.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong Song <yhs@fb.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/bpf/20220705224818.4026623-3-andrii@kernel.org
tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c
tools/testing/selftests/bpf/prog_tests/usdt.c
tools/testing/selftests/bpf/prog_tests/xdp_synproxy.c