diff options
-rw-r--r-- | mm/oom_kill.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c index cdcf89cb9ff2..175a67a78a99 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c | |||
@@ -325,11 +325,8 @@ static void __oom_kill_task(struct task_struct *p, int verbose) | |||
325 | return; | 325 | return; |
326 | } | 326 | } |
327 | 327 | ||
328 | if (!p->mm) { | 328 | if (!p->mm) |
329 | WARN_ON(1); | ||
330 | printk(KERN_WARNING "tried to kill an mm-less task!\n"); | ||
331 | return; | 329 | return; |
332 | } | ||
333 | 330 | ||
334 | if (verbose) | 331 | if (verbose) |
335 | printk(KERN_ERR "Killed process %d (%s)\n", | 332 | printk(KERN_ERR "Killed process %d (%s)\n", |
@@ -397,8 +394,9 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order, | |||
397 | /* | 394 | /* |
398 | * If the task is already exiting, don't alarm the sysadmin or kill | 395 | * If the task is already exiting, don't alarm the sysadmin or kill |
399 | * its children or threads, just set TIF_MEMDIE so it can die quickly | 396 | * its children or threads, just set TIF_MEMDIE so it can die quickly |
397 | * if its mm is still attached. | ||
400 | */ | 398 | */ |
401 | if (p->flags & PF_EXITING) { | 399 | if (p->mm && (p->flags & PF_EXITING)) { |
402 | __oom_kill_task(p, 0); | 400 | __oom_kill_task(p, 0); |
403 | return 0; | 401 | return 0; |
404 | } | 402 | } |