summaryrefslogtreecommitdiff
path: root/arch/sparc
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-03-09 13:00:47 -0800
committerDavid S. Miller <davem@davemloft.net>2011-03-16 18:19:16 -0700
commitc816be7b5f24585baa9eba1f2413935f771d6ad6 (patch)
tree14f45e3bfb4227e6e6f4d0bbc7cfdc2ec70e6f71 /arch/sparc
parent35043c428f1fcb92feb5792f5878a8852ee00771 (diff)
downloadlinux-3.10-c816be7b5f24585baa9eba1f2413935f771d6ad6.tar.gz
linux-3.10-c816be7b5f24585baa9eba1f2413935f771d6ad6.tar.bz2
linux-3.10-c816be7b5f24585baa9eba1f2413935f771d6ad6.zip
sparc32: Fix might-be-used-uninitialized warning in do_sparc_fault().
When we try to handle vmalloc faults, we can take a code path which uses "code" before we actually set it. Amusingly gcc-3.3 notices this yet gcc-4.x does not. Reported-by: Bob Breuer <breuerr@mc.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/mm/fault_32.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/sparc/mm/fault_32.c b/arch/sparc/mm/fault_32.c
index 5b836f5aea9..b10ac4d6237 100644
--- a/arch/sparc/mm/fault_32.c
+++ b/arch/sparc/mm/fault_32.c
@@ -240,11 +240,10 @@ asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write,
* only copy the information from the master page table,
* nothing more.
*/
+ code = SEGV_MAPERR;
if (!ARCH_SUN4C && address >= TASK_SIZE)
goto vmalloc_fault;
- code = SEGV_MAPERR;
-
/*
* If we're in an interrupt or have no user
* context, we must not take the fault..