* [PATCH] MTD: potential leak in rfd_ftl_add_mtd
@ 2007-07-19 20:45 Florin Malita
0 siblings, 0 replies; only message in thread
From: Florin Malita @ 2007-07-19 20:45 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-mtd, Linux Kernel Mailing List
This fixes a leak in the !mtd->erasesize error path (Coverity 1765).
Signed-off-by: Florin Malita <fmalita@gmail.com>
---
drivers/mtd/rfd_ftl.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/mtd/rfd_ftl.c b/drivers/mtd/rfd_ftl.c
index d4b1ba8..006c03a 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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2007-07-19 20:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-19 20:45 [PATCH] MTD: potential leak in rfd_ftl_add_mtd Florin Malita
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox