Re: [Yaffs] [PATCH] memory leak on YAFFS unmount

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Charles Manning
Date:  
To: yaffs
Subject: Re: [Yaffs] [PATCH] memory leak on YAFFS unmount
On Tuesday 21 March 2006 20:01, Nori, Soma Sekhar wrote:
> Hi,
>
> I am using YAFFS2 with MTD. There seems to be a memory leak on YAFFS
> unmount where the spare buffer allocated in yaffs_internal_read_super
> function is not freed at all.
>
> Patch below fixes the issue. Kindly apply.
>
> Regards,
> Sekhar Nori.
>
> --- yaffs_fs.c    2006-03-08 13:29:20.000000000 +0530
> +++ yaffs_fs.c.new    2006-03-21 13:28:40.000000000 +0530
> @@ -1284,6 +1284,10 @@
>      if (dev->putSuperFunc) {
>          dev->putSuperFunc(sb);
>      }
> +
> +    if(dev->isYaffs2 && dev->spareBuffer)
> +        YFREE(dev->spareBuffer);
> +
>      yaffs_Deinitialise(dev);
>      yaffs_GrossUnlock(dev);


Thanx.

I have applied this to cvs in a slightly modified form.

-- Charles