]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mmc: hsmmc: fix use after free bug in omap_hsmmc_remove()
authorLothar Waßmann <LW@KARO-electronics.de>
Wed, 26 Jun 2013 13:26:48 +0000 (15:26 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 26 Jun 2013 13:26:48 +0000 (15:26 +0200)
drivers/mmc/host/omap_hsmmc.c

index 22da8f25537b3ba39e4b25c1caf34555147fce38..2e0af452f8662e63773e709272893f9464e02475 100644 (file)
@@ -2182,6 +2182,8 @@ static int omap_hsmmc_remove(struct platform_device *pdev)
        struct resource *res;
 
        if (host) {
+               void __iomem *base = host->base;
+
                pm_runtime_get_sync(host->dev);
                mmc_remove_host(host->mmc);
                if (host->use_reg)
@@ -2202,7 +2204,7 @@ static int omap_hsmmc_remove(struct platform_device *pdev)
                }
 
                mmc_free_host(host->mmc);
-               iounmap(host->base);
+               iounmap(base);
                omap_hsmmc_gpio_free(pdev->dev.platform_data);
        }