diff options
author | akpm@linux-foundation.org <akpm@linux-foundation.org> | 2007-07-20 20:56:19 +0200 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2007-07-23 13:06:52 +0200 |
commit | 030f9e13bec9aaae1def86c23963a1a825ccdab5 (patch) | |
tree | e5c6af3402bfca4908cace84e1c816f7269ef3a3 /drivers/mtd/rfd_ftl.c | |
parent | [MTD] Fix potential leak in rfd_ftl_add_mtd (diff) | |
download | linux-030f9e13bec9aaae1def86c23963a1a825ccdab5.tar.xz linux-030f9e13bec9aaae1def86c23963a1a825ccdab5.zip |
[MTD] Remove embedded return in RFD FTL.
embedded returns are evil.
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd/rfd_ftl.c')
-rw-r--r-- | drivers/mtd/rfd_ftl.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/mtd/rfd_ftl.c b/drivers/mtd/rfd_ftl.c index 006c03aacb55..823fba4e6d2f 100644 --- a/drivers/mtd/rfd_ftl.c +++ b/drivers/mtd/rfd_ftl.c @@ -779,10 +779,8 @@ 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 + goto out; + } else part->block_size = mtd->erasesize; } @@ -804,7 +802,7 @@ static void rfd_ftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) if (!add_mtd_blktrans_dev((void*)part)) return; } - +out: kfree(part); } |