]> err.no Git - linux-2.6/commitdiff
[MTD] Fix potential leak in rfd_ftl_add_mtd
authorFlorin Malita <fmalita@gmail.com>
Thu, 19 Jul 2007 20:45:18 +0000 (16:45 -0400)
committerDavid Woodhouse <dwmw2@infradead.org>
Thu, 2 Aug 2007 20:44:10 +0000 (21:44 +0100)
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>
drivers/mtd/rfd_ftl.c

index d4b1ba8f23ef40b0dd072fc2c251c46f8f54dc7d..006c03aacb55d1241fc99cae8420c7b8383dda3d 100644 (file)
@@ -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