mtd/drivers/mtd/chips cfi_cmdset_0020.c,1.8,1.9
David Woodhouse
dwmw2 at infradead.org
Mon Oct 6 10:45:35 EDT 2003
Update of /home/cvs/mtd/drivers/mtd/chips
In directory phoenix.infradead.org:/tmp/cvs-serv20762
Modified Files:
cfi_cmdset_0020.c
Log Message:
Fix memory leak on failure
Index: cfi_cmdset_0020.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/chips/cfi_cmdset_0020.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- cfi_cmdset_0020.c 22 Jul 2003 13:23:38 -0000 1.8
+++ cfi_cmdset_0020.c 6 Oct 2003 14:45:32 -0000 1.9
@@ -180,6 +180,7 @@
if (!mtd->eraseregions) {
printk(KERN_ERR "Failed to allocate memory for MTD erase region info\n");
kfree(cfi->cmdset_priv);
+ kfree(mtd);
return NULL;
}
@@ -204,6 +205,7 @@
printk(KERN_WARNING "Sum of regions (%lx) != total size of set of interleaved chips (%lx)\n", offset, devsize);
kfree(mtd->eraseregions);
kfree(cfi->cmdset_priv);
+ kfree(mtd);
return NULL;
}
More information about the linux-mtd-cvs
mailing list