diff options
Diffstat (limited to 'arch/powerpc/mm/fault.c')
-rw-r--r-- | arch/powerpc/mm/fault.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c index 0ece51310bfe..3767211b3d0f 100644 --- a/arch/powerpc/mm/fault.c +++ b/arch/powerpc/mm/fault.c | |||
@@ -145,7 +145,7 @@ int __kprobes do_page_fault(struct pt_regs *regs, unsigned long address, | |||
145 | struct mm_struct *mm = current->mm; | 145 | struct mm_struct *mm = current->mm; |
146 | siginfo_t info; | 146 | siginfo_t info; |
147 | int code = SEGV_MAPERR; | 147 | int code = SEGV_MAPERR; |
148 | int is_write = 0; | 148 | int is_write = 0, ret; |
149 | int trap = TRAP(regs); | 149 | int trap = TRAP(regs); |
150 | int is_exec = trap == 0x400; | 150 | int is_exec = trap == 0x400; |
151 | 151 | ||
@@ -330,22 +330,18 @@ good_area: | |||
330 | * the fault. | 330 | * the fault. |
331 | */ | 331 | */ |
332 | survive: | 332 | survive: |
333 | switch (handle_mm_fault(mm, vma, address, is_write)) { | 333 | ret = handle_mm_fault(mm, vma, address, is_write); |
334 | 334 | if (unlikely(ret & VM_FAULT_ERROR)) { | |
335 | case VM_FAULT_MINOR: | 335 | if (ret & VM_FAULT_OOM) |
336 | current->min_flt++; | 336 | goto out_of_memory; |
337 | break; | 337 | else if (ret & VM_FAULT_SIGBUS) |
338 | case VM_FAULT_MAJOR: | 338 | goto do_sigbus; |
339 | current->maj_flt++; | ||
340 | break; | ||
341 | case VM_FAULT_SIGBUS: | ||
342 | goto do_sigbus; | ||
343 | case VM_FAULT_OOM: | ||
344 | goto out_of_memory; | ||
345 | default: | ||
346 | BUG(); | 339 | BUG(); |
347 | } | 340 | } |
348 | 341 | if (ret & VM_FAULT_MAJOR) | |
342 | current->maj_flt++; | ||
343 | else | ||
344 | current->min_flt++; | ||
349 | up_read(&mm->mmap_sem); | 345 | up_read(&mm->mmap_sem); |
350 | return 0; | 346 | return 0; |
351 | 347 | ||