diff options
author | Jonas Gorski <jogo@openwrt.org> | 2015-07-05 21:31:54 +0000 |
---|---|---|
committer | Jonas Gorski <jogo@openwrt.org> | 2015-07-05 21:31:54 +0000 |
commit | d065daeef905494140cb4cb29356c6e4f7f618c4 (patch) | |
tree | b85ad17b1d06e3852f9a612ba5e39d74937c7722 | |
parent | e8f711120d41dcf1e4e864a2f6d53789a6006d18 (diff) | |
download | master-187ad058-d065daeef905494140cb4cb29356c6e4f7f618c4.tar.gz master-187ad058-d065daeef905494140cb4cb29356c6e4f7f618c4.tar.bz2 master-187ad058-d065daeef905494140cb4cb29356c6e4f7f618c4.zip |
kernel: mips_disable_fpu: initialize fault_addr in fpu_emulator_cop1Handler
Code calling fpu_emulator_cop1Handler will pass on fault_addr, making gcc
complain about it not being initialized when the FPU emulator is disabled.
Fixes:
arch/mips/kernel/traps.c: In function 'do_fpe':
arch/mips/kernel/traps.c:864:22: error: 'fault_addr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
process_fpemu_return(sig, fault_addr, fcr31);
^
arch/mips/kernel/traps.c: In function 'do_ri':
arch/mips/kernel/traps.c:806:22: error: 'fault_addr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
process_fpemu_return(sig, fault_addr, fcr31);
^
arch/mips/kernel/traps.c:763:15: note: 'fault_addr' was declared here
void __user *fault_addr;
^
arch/mips/kernel/traps.c: In function 'do_cpu':
arch/mips/kernel/traps.c:1421:28: error: 'fault_addr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
if (!process_fpemu_return(sig, fault_addr, fcr31) && !err)
^
cc1: all warnings being treated as errors
make[7]: *** [arch/mips/kernel/traps.o] Error 1
Signed-off-by: Jonas Gorski <jogo@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@46184 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r-- | target/linux/generic/patches-4.1/304-mips_disable_fpu.patch | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/target/linux/generic/patches-4.1/304-mips_disable_fpu.patch b/target/linux/generic/patches-4.1/304-mips_disable_fpu.patch index 8b5a1510a3..18004227f5 100644 --- a/target/linux/generic/patches-4.1/304-mips_disable_fpu.patch +++ b/target/linux/generic/patches-4.1/304-mips_disable_fpu.patch @@ -82,7 +82,7 @@ v2: incorporated changes suggested by Jonas Gorski #ifdef CONFIG_DEBUG_FS struct mips_fpu_emulator_stats { -@@ -66,6 +67,20 @@ extern int do_dsemulret(struct pt_regs * +@@ -66,6 +67,21 @@ extern int do_dsemulret(struct pt_regs * extern int fpu_emulator_cop1Handler(struct pt_regs *xcp, struct mips_fpu_struct *ctx, int has_fpu, void *__user *fault_addr); @@ -96,6 +96,7 @@ v2: incorporated changes suggested by Jonas Gorski + struct mips_fpu_struct *ctx, int has_fpu, + void *__user *fault_addr) +{ ++ *fault_addr = NULL; + return SIGILL; /* we don't speak MIPS FPU */ +} +#endif /* CONFIG_MIPS_FPU_EMULATOR */ |