diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/oom_kill.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 991bf0cf4778..a5493a3b4851 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c | |||
@@ -260,14 +260,11 @@ static void __oom_kill_task(struct task_struct *p, const char *message) | |||
260 | return; | 260 | return; |
261 | } | 261 | } |
262 | 262 | ||
263 | task_lock(p); | 263 | if (!p->mm) { |
264 | if (!p->mm || p->mm == &init_mm) { | ||
265 | WARN_ON(1); | 264 | WARN_ON(1); |
266 | printk(KERN_WARNING "tried to kill an mm-less task!\n"); | 265 | printk(KERN_WARNING "tried to kill an mm-less task!\n"); |
267 | task_unlock(p); | ||
268 | return; | 266 | return; |
269 | } | 267 | } |
270 | task_unlock(p); | ||
271 | 268 | ||
272 | if (message) { | 269 | if (message) { |
273 | printk(KERN_ERR "%s: Killed process %d (%s).\n", | 270 | printk(KERN_ERR "%s: Killed process %d (%s).\n", |
@@ -301,7 +298,7 @@ static int oom_kill_task(struct task_struct *p, const char *message) | |||
301 | * However, this is of no concern to us. | 298 | * However, this is of no concern to us. |
302 | */ | 299 | */ |
303 | 300 | ||
304 | if (mm == NULL || mm == &init_mm) | 301 | if (mm == NULL) |
305 | return 1; | 302 | return 1; |
306 | 303 | ||
307 | __oom_kill_task(p, message); | 304 | __oom_kill_task(p, message); |