Browse Source

[MTD] Fix potential leak in rfd_ftl_add_mtd

This fixes a leak in the !mtd->erasesize error path (Coverity 1765).

Signed-off-by: Florin Malita <fmalita@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Florin Malita 18 years ago
parent
commit
1050643431
1 changed files with 1 additions and 0 deletions
  1. 1 0
      drivers/mtd/rfd_ftl.c

+ 1 - 0
drivers/mtd/rfd_ftl.c

@@ -779,6 +779,7 @@ static void rfd_ftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
 	else {
 		if (!mtd->erasesize) {
 			printk(KERN_WARNING PREFIX "please provide block_size");
+			kfree(part);
 			return;
 		}
 		else