linux-sg2042/arch/mips/net
Matt Redfearn 94c3390ab8 MIPS: bpf: Fix uninitialised target compiler error
Compiling ebpf_jit.c with gcc 4.9 results in a (likely spurious)
compiler warning, as gcc has detected that the variable "target" may be
used uninitialised. Since -Werror is active, this is treated as an error
and causes a kernel build failure whenever CONFIG_MIPS_EBPF_JIT is
enabled.

arch/mips/net/ebpf_jit.c: In function 'build_one_insn':
arch/mips/net/ebpf_jit.c:1118:80: error: 'target' may be used
uninitialized in this function [-Werror=maybe-uninitialized]
    emit_instr(ctx, j, target);
                                                                                ^
cc1: all warnings being treated as errors

Fix this by initialising "target" to 0. If it really is used
uninitialised this would result in a jump to 0 and a detectable run time
failure.

Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
Fixes: b6bd53f9c4 ("MIPS: Add missing file for eBPF JIT.")
Cc: James Hogan <james.hogan@imgtec.com>
Cc: David Daney <david.daney@cavium.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Colin Ian King <colin.king@canonical.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Cc: <stable@vger.kernel.org> # v4.13+
Patchwork: https://patchwork.linux-mips.org/patch/17375/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2017-10-09 14:53:38 +02:00
..
Makefile MIPS: Add support for eBPF JIT. 2017-06-28 12:22:39 +02:00
bpf_jit.c MIPS: BPF: Quit clobbering callee saved registers in JIT code. 2017-04-10 11:56:05 +02:00
bpf_jit.h MIPS: BPF: Introduce BPF ASM helpers 2015-06-21 21:54:25 +02:00
bpf_jit_asm.S MIPS: BPF: Fix multiple problems in JIT skb access helpers. 2017-04-10 11:56:05 +02:00
ebpf_jit.c MIPS: bpf: Fix uninitialised target compiler error 2017-10-09 14:53:38 +02:00