All of lore.kernel.org
 help / color / mirror / Atom feed
* either bug or unnecessary code in exit_mm()
@ 2006-03-23 21:34 Christopher Friesen
  0 siblings, 0 replies; only message in thread
From: Christopher Friesen @ 2006-03-23 21:34 UTC (permalink / raw)
  To: Linux Kernel Mailing List


In the last few kernels (at least as far back as 2.6.10), exit_mm() 
looks like this:


static void exit_mm(struct task_struct * tsk)
{
	struct mm_struct *mm = tsk->mm;

	mm_release(tsk, mm);
	if (!mm)
		return;




while mm_release() looks like this:




void mm_release(struct task_struct *tsk, struct mm_struct *mm)
{
	<snip>
	if (tsk->clear_child_tid && atomic_read(&mm->mm_users) > 1) {





If it's valid to call exit_mm() with tsk->mm being NULL, then it seems 
like we'll get problems when we dereference it unconditionally in 
mm_release().

If mm_release() is valid, then the check for !mm in exit_mm() is 
unnecessary but there should probably be a comment.

Can someone tell me which one it is?

Thanks,

Chris

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-03-23 21:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-23 21:34 either bug or unnecessary code in exit_mm() Christopher Friesen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.