From dd95a346026545a2783906830845966bacf53d76 Mon Sep 17 00:00:00 2001 From: Daeseok Youn Date: Fri, 3 Jan 2014 14:10:30 +1100 Subject: [PATCH] kernel/fork.c: remove redundant NULL check in dup_mm() current->mm doesn't need a NULL check in dup_mm(). Becasue dup_mm() is used only in copy_mm() and current->mm is checked whether it is NULL or not in copy_mm() before calling dup_mm(). Signed-off-by: Daeseok Youn Acked-by: Oleg Nesterov Signed-off-by: Andrew Morton --- kernel/fork.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/kernel/fork.c b/kernel/fork.c index 26224886fa21..b824096c4c0b 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -805,9 +805,6 @@ static struct mm_struct *dup_mm(struct task_struct *tsk) struct mm_struct *mm, *oldmm = current->mm; int err; - if (!oldmm) - return NULL; - mm = allocate_mm(); if (!mm) goto fail_nomem; -- 2.39.5