On Wed, Apr 18, 2012 at 03:19:11PM +0530, Venkatraman S wrote:
> From: Russell King - ARM Linux <li...@arm.linux.org.uk>

Please correct this to "Russell King <rmk+ker...@arm.linux.org.uk>"

> 
> res can be one of several resources, as this variable is re-used several
> times during probe.  This can cause the wrong resource parameters to be
> passed to release_mem_region().
> 
> Get the original memory resource before calling release_mem_region().
> 
> Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk>
> Signed-off-by: Venkatraman S <svenk...@ti.com>
> ---
>  drivers/mmc/host/omap_hsmmc.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index 4254b6f..d15b149 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -2042,7 +2042,9 @@ err1:
>  err_alloc:
>       omap_hsmmc_gpio_free(pdata);
>  err:
> -     release_mem_region(res->start, resource_size(res));
> +     res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +     if (res)
> +             release_mem_region(res->start, resource_size(res));
>       return ret;
>  }
>  
> -- 
> 1.7.10.rc2
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to