sparc: Use page_fault_out_of_memory() for VM_FAULT_OOM.
[deliverable/linux.git] / arch / sparc / mm / fault_32.c
index a507e1174662e2bd0072a739d217a7480bcd60c2..b99f81c4906f72ae3486c54d3cc1e69d15822383 100644 (file)
@@ -241,7 +241,7 @@ good_area:
         * make sure we exit gracefully rather than endlessly redo
         * the fault.
         */
-       fault = handle_mm_fault(mm, vma, address, write);
+       fault = handle_mm_fault(mm, vma, address, write ? FAULT_FLAG_WRITE : 0);
        if (unlikely(fault & VM_FAULT_ERROR)) {
                if (fault & VM_FAULT_OOM)
                        goto out_of_memory;
@@ -283,7 +283,8 @@ bad_area_nosemaphore:
        /* Is this in ex_table? */
 no_context:
        g2 = regs->u_regs[UREG_G2];
-       if (!from_user && (fixup = search_extables_range(regs->pc, &g2))) {
+       if (!from_user) {
+               fixup = search_extables_range(regs->pc, &g2);
                if (fixup > 10) { /* Values below are reserved for other things */
                        extern const unsigned __memset_start[];
                        extern const unsigned __memset_end[];
@@ -318,9 +319,10 @@ no_context:
  */
 out_of_memory:
        up_read(&mm->mmap_sem);
-       printk("VM: killing process %s\n", tsk->comm);
-       if (from_user)
-               do_group_exit(SIGKILL);
+       if (from_user) {
+               pagefault_out_of_memory();
+               return;
+       }
        goto no_context;
 
 do_sigbus:
@@ -483,7 +485,7 @@ good_area:
                if(!(vma->vm_flags & (VM_READ | VM_EXEC)))
                        goto bad_area;
        }
-       switch (handle_mm_fault(mm, vma, address, write)) {
+       switch (handle_mm_fault(mm, vma, address, write ? FAULT_FLAG_WRITE : 0)) {
        case VM_FAULT_SIGBUS:
        case VM_FAULT_OOM:
                goto do_sigbus;
This page took 0.03646 seconds and 5 git commands to generate.