aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c
diff options
context:
space:
mode:
authorLorenz Bauer <lmb@cloudflare.com>2019-05-08 17:49:32 +0100
committerAlexei Starovoitov <ast@kernel.org>2019-05-09 15:53:56 -0700
commit07b619919d3d5401adc9bc6b79dcf12cc2c6d485 (patch)
tree7592791ba5b9f6bd2dbdb17b0537f4eb0df23b43 /tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c
parentnet/tcp: use deferred jump label for TCP acked data hook (diff)
downloadlinux-dev-07b619919d3d5401adc9bc6b79dcf12cc2c6d485.tar.xz
linux-dev-07b619919d3d5401adc9bc6b79dcf12cc2c6d485.zip
selftests: bpf: initialize bpf_object pointers where needed
There are a few tests which call bpf_object__close on uninitialized bpf_object*, which may segfault. Explicitly zero-initialise these pointers to avoid this. Signed-off-by: Lorenz Bauer <lmb@cloudflare.com> Acked-by: Martin KaFai Lau <kafai@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c b/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c
index 23b159d95c3f..b74e2f6e96d0 100644
--- a/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c
+++ b/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c
@@ -15,7 +15,7 @@ static int libbpf_debug_print(enum libbpf_print_level level,
static int check_load(const char *file)
{
struct bpf_prog_load_attr attr;
- struct bpf_object *obj;
+ struct bpf_object *obj = NULL;
int err, prog_fd;
memset(&attr, 0, sizeof(struct bpf_prog_load_attr));