diff mbox

[3/4] mmc: omap_hsmmc: fix host reference after mmc_free_host

Message ID 1350317108-10657-3-git-send-email-svenkatr@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Venkatraman S Oct. 15, 2012, 4:05 p.m. UTC
From: Balaji T K <balajitk@ti.com>

struct omap_hsmmc_host *host should not be accessed after mmc_free_host().
Reorder mmc_free_host() after iounmap(host->base).

Signed-off-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Venkatraman S <svenkatr@ti.com>
---
 drivers/mmc/host/omap_hsmmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Chris Ball Oct. 29, 2012, 4:56 p.m. UTC | #1
Hi,

On Mon, Oct 15 2012, Venkatraman S wrote:
> From: Balaji T K <balajitk@ti.com>
>
> struct omap_hsmmc_host *host should not be accessed after mmc_free_host().
> Reorder mmc_free_host() after iounmap(host->base).
>
> Signed-off-by: Balaji T K <balajitk@ti.com>
> Signed-off-by: Venkatraman S <svenkatr@ti.com>
> ---
>  drivers/mmc/host/omap_hsmmc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index a33ab74..a3929b7 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -2019,8 +2019,8 @@ static int __devexit omap_hsmmc_remove(struct platform_device *pdev)
>  		clk_put(host->dbclk);
>  	}
>  
> -	mmc_free_host(host->mmc);
>  	iounmap(host->base);
> +	mmc_free_host(host->mmc);
>  	omap_hsmmc_gpio_free(pdev->dev.platform_data);
>  
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);

Thanks, pushed to mmc-next for 3.7.

- Chris.
diff mbox

Patch

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index a33ab74..a3929b7 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -2019,8 +2019,8 @@  static int __devexit omap_hsmmc_remove(struct platform_device *pdev)
 		clk_put(host->dbclk);
 	}
 
-	mmc_free_host(host->mmc);
 	iounmap(host->base);
+	mmc_free_host(host->mmc);
 	omap_hsmmc_gpio_free(pdev->dev.platform_data);
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);