[Yaffs] [PATCH] memory leak on YAFFS unmount

Charles Manning manningc2 at actrix.gen.nz
Tue Mar 21 20:37:04 GMT 2006


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



More information about the yaffs mailing list