Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0772dac1 authored by Felipe Pena's avatar Felipe Pena Committed by Linus Torvalds
Browse files

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 759496ba ("arch: mm: pass
userspace fault flag to generic fault handler")

Signed-off-by: default avatarFelipe Pena <felipensp@gmail.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
Cc: Helge Deller <deller@gmx.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 2a156a6b
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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:
@@ -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;