[Yaffs] [PATCH] memory leak on YAFFS unmount

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Nori, Soma Sekhar
Date:  
To: yaffs
Subject: [Yaffs] [PATCH] memory leak on YAFFS unmount

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