kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kernel/fork.c : remove redundant NULL check in dup_mm()
@ 2013-11-28  6:18 Daeseok Youn
  2013-11-28 11:28 ` Oleg Nesterov
  0 siblings, 1 reply; 2+ messages in thread
From: Daeseok Youn @ 2013-11-28  6:18 UTC (permalink / raw)
  To: kernel-janitors

From f19c414860a1231460cd3380a7a15f6fb630ef64 Mon Sep 17 00:00:00 2001
From: Daeseok Youn <daeseok.youn@gmail.com>
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 <daeseok.youn@gmail.com>
---
 kernel/fork.c |    3 ---
 1 file changed, 3 deletions(-)

diff --git a/kernel/fork.c b/kernel/fork.c
index 728d5be..9339bbc 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -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;
-- 
1.7.9.5

---

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] kernel/fork.c : remove redundant NULL check in dup_mm()
  2013-11-28  6:18 [PATCH] kernel/fork.c : remove redundant NULL check in dup_mm() Daeseok Youn
@ 2013-11-28 11:28 ` Oleg Nesterov
  0 siblings, 0 replies; 2+ messages in thread
From: Oleg Nesterov @ 2013-11-28 11:28 UTC (permalink / raw)
  To: kernel-janitors

On 11/28, Daeseok Youn wrote:
>
> --- a/kernel/fork.c
> +++ b/kernel/fork.c
> @@ -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 <oleg@redhat.com>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-11-28 11:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-28  6:18 [PATCH] kernel/fork.c : remove redundant NULL check in dup_mm() Daeseok Youn
2013-11-28 11:28 ` Oleg Nesterov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).