linux-mips
[Top] [All Lists]

Re: BUG : Memory leak in Linux 2.4.2 MIPS SMP kernel

To: Ralf Baechle <ralf@oss.sgi.com>
Subject: Re: BUG : Memory leak in Linux 2.4.2 MIPS SMP kernel
From: James Simmons <jsimmons@transvirtual.com>
Date: Tue, 13 Nov 2001 16:16:57 -0800 (PST)
Cc: Krishna Kondaka <krishna@sanera.net>, linux-mips@oss.sgi.com
In-reply-to: <20011114104753.A10410@dea.linux-mips.net>
Sender: owner-linux-mips@oss.sgi.com
> > {
> > #ifdef CONFIG_SMP
> >         kfree((void *)mm->context);
> > #else
> >         /* Nothing to do.  */
> > #endif
> > }
> > 
> > And when I tested this I do not see the memory leak any more.
> 
> Almost correct, as James already explained you have to check for a
> non-null pointer first.  

Hm. It was pointed out that kfree actually does the checking for us. 
Do we really need the check? 

> We got a more elegant implementation of
> context switching which I'll add to CVS asap; it gets away without
> any memory allocation.

:-)


<Prev in Thread] Current Thread [Next in Thread>