public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix check after use in kernel/exit.c
@ 2008-03-08  8:11 WANG Cong
  2008-03-08  8:36 ` Ingo Molnar
  0 siblings, 1 reply; 7+ messages in thread
From: WANG Cong @ 2008-03-08  8:11 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Ingo Molnar, G. Vaughan, Andrew Morton


mm_release won't check the mm_struct pointer, so it should
be checked before this call.

This patch was first posted here[1], and I don't know
why it was not accepted yet.

Thanks to "G. Vaughan" to remind me about this.

1. http://lkml.org/lkml/2007/11/15/520

Cc: Ingo Molnar <mingo@elte.hu>
Cc: "G. Vaughan" <gvaughan@jpl.nasa.gov>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>

---
 kernel/exit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/exit.c b/kernel/exit.c
index cd20bf0..0cb9cce 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -582,9 +582,9 @@ static void exit_mm(struct task_struct * tsk)
 {
 	struct mm_struct *mm = tsk->mm;
 
-	mm_release(tsk, mm);
 	if (!mm)
 		return;
+	mm_release(tsk, mm);
 	/*
 	 * Serialize with any possible pending coredump.
 	 * We must hold mmap_sem around checking core_waiters
-- 
1.5.2.4


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

end of thread, other threads:[~2008-03-10  9:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-08  8:11 [PATCH] Fix check after use in kernel/exit.c WANG Cong
2008-03-08  8:36 ` Ingo Molnar
2008-03-08  8:53   ` Ingo Molnar
2008-03-08  8:58     ` WANG Cong
2008-03-09 11:48       ` Ingo Molnar
2008-03-10  8:23         ` WANG Cong
2008-03-10  9:13           ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox