Re: [PATCH] selftests/bpf: Fix check in global_data_init.

2020-09-03 Thread Alexei Starovoitov
On Thu, Sep 3, 2020 at 1:36 PM Andrii Nakryiko wrote: > > On Thu, Sep 3, 2020 at 1:06 PM Hao Luo wrote: > > > > 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

Re: [PATCH] selftests/bpf: Fix check in global_data_init.

2020-09-03 Thread Andrii Nakryiko
On Thu, Sep 3, 2020 at 1:06 PM Hao Luo wrote: > > 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 > --- thanks! Acked-by:

[PATCH] selftests/bpf: Fix check in global_data_init.

2020-09-03 Thread Hao Luo
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 --- tools/testing/selftests/bpf/prog_tests/global_data_init.c | 3 ++- 1 file changed,

Re: [PATCH] selftests/bpf: Fix check in global_data_init.

2020-09-03 Thread Hao Luo
No problem! Let me update and resend. On Thu, Sep 3, 2020 at 11:50 AM Andrii Nakryiko wrote: > > On Thu, Sep 3, 2020 at 11:02 AM Hao Luo wrote: > > > > The returned value of bpf_object__open_file() should be checked with > > IS_ERR() rather than NULL. This fix makes test_progs not crash when >

Re: [PATCH] selftests/bpf: Fix check in global_data_init.

2020-09-03 Thread Andrii Nakryiko
On Thu, Sep 3, 2020 at 11:02 AM Hao Luo wrote: > > The returned value of bpf_object__open_file() should be checked with > IS_ERR() rather than NULL. This fix makes test_progs not crash when > test_global_data.o is not present. > > Signed-off-by: Hao Luo > --- >

[PATCH] selftests/bpf: Fix check in global_data_init.

2020-09-03 Thread Hao Luo
The returned value of bpf_object__open_file() should be checked with IS_ERR() rather than NULL. This fix makes test_progs not crash when test_global_data.o is not present. Signed-off-by: Hao Luo --- tools/testing/selftests/bpf/prog_tests/global_data_init.c | 2 +- 1 file changed, 1