mtd/drivers/mtd ftl.c,1.53,1.54

David Woodhouse dwmw2 at infradead.org
Tue Nov 16 13:33:18 EST 2004


Update of /home/cvs/mtd/drivers/mtd
In directory phoenix.infradead.org:/tmp/cvs-serv30863

Modified Files:
	ftl.c 
Log Message:
Free all data structures on partition going away.


Index: ftl.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/ftl.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- ftl.c	9 Aug 2004 13:55:43 -0000	1.53
+++ ftl.c	16 Nov 2004 18:33:15 -0000	1.54
@@ -1067,16 +1067,18 @@
 		partition->mbd.blksize = SECTOR_SIZE;
 		partition->mbd.tr = tr;
 		partition->mbd.devnum = -1;
-		if (add_mtd_blktrans_dev((void *)partition))
-			kfree(partition);
-	
-	} else
-		kfree(partition);
+		if (!add_mtd_blktrans_dev((void *)partition))
+			return;
+	}
+
+	ftl_freepart(partition);
+	kfree(partition);
 }
 
 static void ftl_remove_dev(struct mtd_blktrans_dev *dev)
 {
 	del_mtd_blktrans_dev(dev);
+	ftl_freepart((partition_t *)dev);
 	kfree(dev);
 }
 





More information about the linux-mtd-cvs mailing list