diff options
Diffstat (limited to 'arch/powerpc/mm/fault.c')
-rw-r--r-- | arch/powerpc/mm/fault.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c index 0a6b28336eb0..3a8489a354e9 100644 --- a/arch/powerpc/mm/fault.c +++ b/arch/powerpc/mm/fault.c | |||
@@ -113,19 +113,6 @@ static int store_updates_sp(struct pt_regs *regs) | |||
113 | #define MM_FAULT_CONTINUE -1 | 113 | #define MM_FAULT_CONTINUE -1 |
114 | #define MM_FAULT_ERR(sig) (sig) | 114 | #define MM_FAULT_ERR(sig) (sig) |
115 | 115 | ||
116 | static int out_of_memory(struct pt_regs *regs) | ||
117 | { | ||
118 | /* | ||
119 | * We ran out of memory, or some other thing happened to us that made | ||
120 | * us unable to handle the page fault gracefully. | ||
121 | */ | ||
122 | up_read(¤t->mm->mmap_sem); | ||
123 | if (!user_mode(regs)) | ||
124 | return MM_FAULT_ERR(SIGKILL); | ||
125 | pagefault_out_of_memory(); | ||
126 | return MM_FAULT_RETURN; | ||
127 | } | ||
128 | |||
129 | static int do_sigbus(struct pt_regs *regs, unsigned long address) | 116 | static int do_sigbus(struct pt_regs *regs, unsigned long address) |
130 | { | 117 | { |
131 | siginfo_t info; | 118 | siginfo_t info; |
@@ -169,8 +156,18 @@ static int mm_fault_error(struct pt_regs *regs, unsigned long addr, int fault) | |||
169 | return MM_FAULT_CONTINUE; | 156 | return MM_FAULT_CONTINUE; |
170 | 157 | ||
171 | /* Out of memory */ | 158 | /* Out of memory */ |
172 | if (fault & VM_FAULT_OOM) | 159 | if (fault & VM_FAULT_OOM) { |
173 | return out_of_memory(regs); | 160 | up_read(¤t->mm->mmap_sem); |
161 | |||
162 | /* | ||
163 | * We ran out of memory, or some other thing happened to us that | ||
164 | * made us unable to handle the page fault gracefully. | ||
165 | */ | ||
166 | if (!user_mode(regs)) | ||
167 | return MM_FAULT_ERR(SIGKILL); | ||
168 | pagefault_out_of_memory(); | ||
169 | return MM_FAULT_RETURN; | ||
170 | } | ||
174 | 171 | ||
175 | /* Bus error. x86 handles HWPOISON here, we'll add this if/when | 172 | /* Bus error. x86 handles HWPOISON here, we'll add this if/when |
176 | * we support the feature in HW | 173 | * we support the feature in HW |