lkml.org 
[lkml]   [2011]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] drivers/mtd/nand/bcm_umi_nand.c: add missing kfree/ioremap
On 10/08/11 15:42, Julia Lawall wrote:
> 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

This probe function should possibly use goto exits on failure. It
reduces a bit of code duplication and helps prevent this type of error.

~Ryan



\
 
 \ /
  Last update: 2011-08-10 08:05    [from the cache]
©2003-2011 Jasper Spaans