bpf: arm64: fix uninitialized variable
authorAlexei Starovoitov <ast@fb.com>
Mon, 18 Dec 2017 18:09:44 +0000 (10:09 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 19 Dec 2017 00:29:25 +0000 (01:29 +0100)
fix the following issue:
arch/arm64/net/bpf_jit_comp.c: In function 'bpf_int_jit_compile':
arch/arm64/net/bpf_jit_comp.c:982:18: error: 'image_size' may be used
uninitialized in this function [-Werror=maybe-uninitialized]

Fixes: db496944fdaa ("bpf: arm64: add JIT support for multi-function programs")
Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
arch/arm64/net/bpf_jit_comp.c

index 396490cf7316b6179a2ab3ccf83a2eb302841c9f..acaa935ed977f128dc5d1248adea3b2a6a8580fc 100644 (file)
@@ -897,6 +897,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
                image_ptr = jit_data->image;
                header = jit_data->header;
                extra_pass = true;
+               image_size = sizeof(u32) * ctx.idx;
                goto skip_init_ctx;
        }
        memset(&ctx, 0, sizeof(ctx));