aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/mm/fault.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/i386/mm/fault.c')
-rw-r--r--arch/i386/mm/fault.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/arch/i386/mm/fault.c b/arch/i386/mm/fault.c
index 1ecb3e43b523..e92a10124935 100644
--- a/arch/i386/mm/fault.c
+++ b/arch/i386/mm/fault.c
@@ -303,6 +303,7 @@ fastcall void __kprobes do_page_fault(struct pt_regs *regs,
303 struct vm_area_struct * vma; 303 struct vm_area_struct * vma;
304 unsigned long address; 304 unsigned long address;
305 int write, si_code; 305 int write, si_code;
306 int fault;
306 307
307 /* get the address */ 308 /* get the address */
308 address = read_cr2(); 309 address = read_cr2();
@@ -422,20 +423,18 @@ good_area:
422 * make sure we exit gracefully rather than endlessly redo 423 * make sure we exit gracefully rather than endlessly redo
423 * the fault. 424 * the fault.
424 */ 425 */
425 switch (handle_mm_fault(mm, vma, address, write)) { 426 fault = handle_mm_fault(mm, vma, address, write);
426 case VM_FAULT_MINOR: 427 if (unlikely(fault & VM_FAULT_ERROR)) {
427 tsk->min_flt++; 428 if (fault & VM_FAULT_OOM)
428 break;
429 case VM_FAULT_MAJOR:
430 tsk->maj_flt++;
431 break;
432 case VM_FAULT_SIGBUS:
433 goto do_sigbus;
434 case VM_FAULT_OOM:
435 goto out_of_memory; 429 goto out_of_memory;
436 default: 430 else if (fault & VM_FAULT_SIGBUS)
437 BUG(); 431 goto do_sigbus;
432 BUG();
438 } 433 }
434 if (fault & VM_FAULT_MAJOR)
435 tsk->maj_flt++;
436 else
437 tsk->min_flt++;
439 438
440 /* 439 /*
441 * Did it hit the DOS screen memory VA from vm86 mode? 440 * Did it hit the DOS screen memory VA from vm86 mode?