Skip to content

Commit 0772dac

Browse files
felipensptorvalds
authored andcommitted
arch/parisc/mm/fault.c: fix uninitialized variable usage
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]>
1 parent 2a156a6 commit 0772dac

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

arch/parisc/mm/fault.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@ void do_page_fault(struct pt_regs *regs, unsigned long code,
182182

183183
if (user_mode(regs))
184184
flags |= FAULT_FLAG_USER;
185+
186+
acc_type = parisc_acctyp(code, regs->iir);
187+
185188
if (acc_type & VM_WRITE)
186189
flags |= FAULT_FLAG_WRITE;
187190
retry:
@@ -196,8 +199,6 @@ void do_page_fault(struct pt_regs *regs, unsigned long code,
196199

197200
good_area:
198201

199-
acc_type = parisc_acctyp(code,regs->iir);
200-
201202
if ((vma->vm_flags & acc_type) != acc_type)
202203
goto bad_area;
203204

0 commit comments

Comments
 (0)