Skip to content

Commit

Permalink
sparc32: Fix might-be-used-uninitialized warning in do_sparc_fault().
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David S. Miller committed Mar 17, 2011
1 parent 35043c4 commit c816be7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions arch/sparc/mm/fault_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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..
Expand Down

0 comments on commit c816be7

Please sign in to comment.