kernel/fork.c : remove redundant NULL check in dup_mm()
Subsystems (4)
PATCH 1/1 kernel/fork.c : remove redundant NULL check in dup_mm()
From f19c414860a1231460cd3380a7a15f6fb630ef64 Mon Sep 17 00:00:00 2001
From: Daeseok Youn <[email protected]>
Date: Thu, 28 Nov 2013 10:52:03 +0900
Subject: [PATCH] kernel/fork.c : remove redundant NULL check in dup_mm()
current->mm doesn't need to check NULL 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 <[email protected]>
--- kernel/fork.c | 3 --- 1 file changed, 3 deletions(-)
kernel/fork.c +0 -3
@@ -804,9 +804,6 @@ 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;
Signature · 3 lines
1.7.9.5 ---
kernel/fork.c struct mm_struct *dup_mm(struct task_struct *tsk) · line 809
Quoted 13 lines · Daeseok Youn
kernel/fork.c +0
-3@@ -804,9 +804,6 @@ 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;
Acked-by Oleg Nesterov <[email protected]>