]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
sparc32: Fix might-be-used-uninitialized warning in do_sparc_fault().
authorDavid S. Miller <davem@davemloft.net>
Wed, 9 Mar 2011 21:00:47 +0000 (13:00 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 21 Apr 2011 21:32:39 +0000 (14:32 -0700)
[ Upstream commit c816be7b5f24585baa9eba1f2413935f771d6ad6 ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/sparc/mm/fault_32.c

index 5b836f5aea90bcd94d4e4ba1b3114a8115291135..b10ac4d62378a3705e52a010feb5e326f41b2d2f 100644 (file)
@@ -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..