Re: [PATCH] mxcmmc: fix error path in mxcmci_probe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 24, 2009 at 09:44:14AM +0200, Uwe Kleine-König wrote:
> After a failing allocation of mmc or a failed ioremap in mxcmci_probe host was
> used uninitialized.

Acked-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>

> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
> Cc: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
> Cc: Pierre Ossman <pierre@xxxxxxxxx>
> Cc: Martin Fuzzey <mfuzzey@xxxxxxxxx>
> Cc: Pierre Ossman <drzeus@xxxxxxxxx>
> ---
>  drivers/mmc/host/mxcmmc.c |   10 +++++-----
>  1 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
> index bc14bb1..bec4605 100644
> --- a/drivers/mmc/host/mxcmmc.c
> +++ b/drivers/mmc/host/mxcmmc.c
> @@ -679,17 +679,17 @@ static int mxcmci_probe(struct platform_device *pdev)
>  {
>  	struct mmc_host *mmc;
>  	struct mxcmci_host *host = NULL;
> -	struct resource *r;
> +	struct resource *iores, *r;
>  	int ret = 0, irq;
>  
>  	printk(KERN_INFO "i.MX SDHC driver\n");
>  
> -	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	irq = platform_get_irq(pdev, 0);
> -	if (!r || irq < 0)
> +	if (!iores || irq < 0)
>  		return -EINVAL;
>  
> -	r = request_mem_region(r->start, resource_size(r), pdev->name);
> +	r = request_mem_region(iores->start, resource_size(iores), pdev->name);
>  	if (!r)
>  		return -EBUSY;
>  
> @@ -809,7 +809,7 @@ out_iounmap:
>  out_free:
>  	mmc_free_host(mmc);
>  out_release_mem:
> -	release_mem_region(host->res->start, resource_size(host->res));
> +	release_mem_region(iores->start, resource_size(iores));
>  	return ret;
>  }
>  
> -- 
> 1.6.4.3
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux