Skip to content

Commit

Permalink
arch/parisc/mm/fault.c: fix uninitialized variable usage
Browse files Browse the repository at this point in the history
The FAULT_FLAG_WRITE flag has been set based on uninitialized variable.

Fixes a regression added by commit 759496b ("arch: mm: pass
userspace fault flag to generic fault handler")

Signed-off-by: Felipe Pena <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
felipensp authored and torvalds committed Sep 30, 2013
1 parent 2a156a6 commit 0772dac
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arch/parisc/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ void do_page_fault(struct pt_regs *regs, unsigned long code,

if (user_mode(regs))
flags |= FAULT_FLAG_USER;

acc_type = parisc_acctyp(code, regs->iir);

if (acc_type & VM_WRITE)
flags |= FAULT_FLAG_WRITE;
retry:
Expand All @@ -196,8 +199,6 @@ void do_page_fault(struct pt_regs *regs, unsigned long code,

good_area:

acc_type = parisc_acctyp(code,regs->iir);

if ((vma->vm_flags & acc_type) != acc_type)
goto bad_area;

Expand Down

0 comments on commit 0772dac

Please sign in to comment.