linux-mips
[Top] [All Lists]

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

To: Krishna Kondaka <krishna@Sanera.net>
Subject: Re: BUG : Memory leak in Linux 2.4.2 MIPS SMP kernel
From: James Simmons <jsimmons@transvirtual.com>
Date: Tue, 13 Nov 2001 15:42:26 -0800 (PST)
Cc: ralf@gnu.org, linux-mips@oss.sgi.com
In-reply-to: <200111132336.PAA06294@exceed1.sanera.net>
Sender: owner-linux-mips@oss.sgi.com
> 1. Summary:
>       Memory leak in Linux 2.4.2 MIPS SMP kernel

Fixed in the latest tree.

> /*
>  * Destroy context related info for an mm_struct that is about
>  * to be put to rest.
>  */
> extern inline void destroy_context(struct mm_struct *mm)
> {
> #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.

BTW you should check to see if mm->context really exist. It can bomb out
otherwise.

Current function is:

static inline void destroy_context(struct mm_struct *mm)
{
#ifdef CONFIG_SMP
        if (mm->context)
                kfree((void *)mm->context);
#endif
}



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