[PATCH] drivers/mtd/nand/bcm_umi_nand.c: add missing kfree/ioremap

August 10th, 2011 - 01:50 am ET by Julia Lawall | Report spam
From: Julia Lawall <julia@diku.dk>

The error handling code under the #if should be the same as elsewhere in
the function.

Signed-off-by: Julia Lawall <julia@diku.dk>


drivers/mtd/nand/bcm_umi_nand.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/bcm_umi_nand.c b/drivers/mtd/nand/bcm_umi_nand.c
index a8ae898..72e8ec2 100644
a/drivers/mtd/nand/bcm_umi_nand.c
+++ b/drivers/mtd/nand/bcm_umi_nand.c
@@ -433,8 +433,11 @@ static int __devinit bcm_umi_nand_probe(struct platform_device *pdev)

#if USE_DMA
err = nand_dma_init();
- if (err != 0)
+ if (err != 0) {
+ iounmap(bcm_umi_io_base);
+ kfree(board_mtd);
return err;
+ }
#endif

/* Figure out the size of the device that we have.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
email Follow the discussionReplies 3 repliesReplies Make a reply

Replies

#1 Julia Lawall
August 10th, 2011 - 02:00 am ET | Report spam
Oops, please ignore this patch. I missed another similar problem in the
same function.

julia


On Wed, 10 Aug 2011, Julia Lawall wrote:

From: Julia Lawall

The error handling code under the #if should be the same as elsewhere in
the function.

Signed-off-by: Julia Lawall


drivers/mtd/nand/bcm_umi_nand.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/bcm_umi_nand.c b/drivers/mtd/nand/bcm_umi_nand.c
index a8ae898..72e8ec2 100644
a/drivers/mtd/nand/bcm_umi_nand.c
+++ b/drivers/mtd/nand/bcm_umi_nand.c
@@ -433,8 +433,11 @@ static int __devinit bcm_umi_nand_probe(struct platform_device *pdev)

#if USE_DMA
err = nand_dma_init();
- if (err != 0)
+ if (err != 0) {
+ iounmap(bcm_umi_io_base);
+ kfree(board_mtd);
return err;
+ }
#endif

/* Figure out the size of the device that we have.

To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to
More majordomo info at http://vger.kernel.org/majordomo-info.html



To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Similar topics