summaryrefslogtreecommitdiffstats
path: root/arch/m68k/mm/fault.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/m68k/mm/fault.c')
-rw-r--r--arch/m68k/mm/fault.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/arch/m68k/mm/fault.c b/arch/m68k/mm/fault.c
index ef1b855bd..c66db0652 100644
--- a/arch/m68k/mm/fault.c
+++ b/arch/m68k/mm/fault.c
@@ -36,7 +36,7 @@ asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address,
struct mm_struct *mm = current->mm;
struct vm_area_struct * vma;
unsigned long fixup;
- int write;
+ int write, fault;
#ifdef DEBUG
printk ("regs->sr=%#x, regs->pc=%#lx, address=%#lx, %ld, %p\n",
@@ -44,12 +44,11 @@ asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address,
current->mm->pgd);
#endif
-
/*
* If we're in an interrupt or have no user
* context, we must not take the fault..
*/
- if (in_interrupt() || mm == &init_mm)
+ if (in_interrupt() || !mm)
goto no_context;
down(&mm->mmap_sem);
@@ -100,7 +99,10 @@ good_area:
* make sure we exit gracefully rather than endlessly redo
* the fault.
*/
- if (!handle_mm_fault(current, vma, address, write))
+ fault = handle_mm_fault(current, vma, address, write);
+ if (fault < 0)
+ goto out_of_memory;
+ if (!fault)
goto do_sigbus;
/* There seems to be a missing invalidate somewhere in do_no_page.
@@ -160,6 +162,13 @@ no_context:
* We ran out of memory, or some other thing happened to us that made
* us unable to handle the page fault gracefully.
*/
+out_of_memory:
+ up(&mm->mmap_sem);
+ printk("VM: killing process %s\n", current->comm);
+ if (error_code & 4)
+ do_exit(SIGKILL);
+ goto no_context;
+
do_sigbus:
up(&mm->mmap_sem);