[Yaffs] [PATCH] memory leak on YAFFS unmount

Nori, Soma Sekhar nsekhar at ti.com
Tue Mar 21 08:01:55 GMT 2006


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);



More information about the yaffs mailing list