]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Fix check in global_data_init.
authorHao Luo <haoluo@google.com>
Thu, 3 Sep 2020 20:05:28 +0000 (13:05 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 4 Sep 2020 00:33:31 +0000 (17:33 -0700)
commitbb2b6fb685b03b2a9b92c7e3591d5313db85f38f
tree84f648ba51fa70be277215e72b2113c532f319d4
parentf502d779c38600cc16690a8d28b64dfb4186b5e9
selftests/bpf: Fix check in global_data_init.

The returned value of bpf_object__open_file() should be checked with
libbpf_get_error() rather than NULL. This fix prevents test_progs from
crash when test_global_data.o is not present.

Signed-off-by: Hao Luo <haoluo@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20200903200528.747884-1-haoluo@google.com
tools/testing/selftests/bpf/prog_tests/global_data_init.c