From: Florin Malita Date: Thu, 19 Jul 2007 20:45:18 +0000 (-0400) Subject: [MTD] Fix potential leak in rfd_ftl_add_mtd X-Git-Tag: v2.6.23-rc2~11^2~4 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=47af05dd4b98b57eeb682596a0df42d106e02167;p=linux-2.6-omap-h63xx.git [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 Signed-off-by: David Woodhouse --- diff --git a/drivers/mtd/rfd_ftl.c b/drivers/mtd/rfd_ftl.c index d4b1ba8f23e..006c03aacb5 100644 --- a/drivers/mtd/rfd_ftl.c +++ b/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