Skip to contentSkip to conversation

arch/parisc: mm: fix uninitialized variable usage

PATCH New Felipe Pena 1 participant 1 message Sep 23, 2013 PA-RISC architecture

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 arch/parisc: mm: fix uninitialized variable usage

The FAULT_FLAG_WRITE flag has been set based on uninitialized variable

---
 arch/parisc/mm/fault.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/parisc/mm/fault.c +3 -1
index d10d27a..00c0ed3 100644
@@ -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 @@ retry:
 
 good_area:
 
-	acc_type = parisc_acctyp(code,regs->iir);