diff options
Diffstat (limited to 'arch/parisc/mm/fault.c')
-rw-r--r-- | arch/parisc/mm/fault.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c index 00c0ed333a3d..0293588d5b8c 100644 --- a/arch/parisc/mm/fault.c +++ b/arch/parisc/mm/fault.c | |||
@@ -171,20 +171,25 @@ void do_page_fault(struct pt_regs *regs, unsigned long code, | |||
171 | unsigned long address) | 171 | unsigned long address) |
172 | { | 172 | { |
173 | struct vm_area_struct *vma, *prev_vma; | 173 | struct vm_area_struct *vma, *prev_vma; |
174 | struct task_struct *tsk = current; | 174 | struct task_struct *tsk; |
175 | struct mm_struct *mm = tsk->mm; | 175 | struct mm_struct *mm; |
176 | unsigned long acc_type; | 176 | unsigned long acc_type; |
177 | int fault; | 177 | int fault; |
178 | unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; | 178 | unsigned int flags; |
179 | 179 | ||
180 | if (in_atomic() || !mm) | 180 | if (in_atomic()) |
181 | goto no_context; | 181 | goto no_context; |
182 | 182 | ||
183 | tsk = current; | ||
184 | mm = tsk->mm; | ||
185 | if (!mm) | ||
186 | goto no_context; | ||
187 | |||
188 | flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; | ||
183 | if (user_mode(regs)) | 189 | if (user_mode(regs)) |
184 | flags |= FAULT_FLAG_USER; | 190 | flags |= FAULT_FLAG_USER; |
185 | 191 | ||
186 | acc_type = parisc_acctyp(code, regs->iir); | 192 | acc_type = parisc_acctyp(code, regs->iir); |
187 | |||
188 | if (acc_type & VM_WRITE) | 193 | if (acc_type & VM_WRITE) |
189 | flags |= FAULT_FLAG_WRITE; | 194 | flags |= FAULT_FLAG_WRITE; |
190 | retry: | 195 | retry: |