summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPratibhasagar V <pratibha@codeaurora.org>2014-04-09 12:52:46 +0530
committerSubhash Jadavani <subhashj@codeaurora.org>2016-05-31 15:25:58 -0700
commit90102c17f9caaaf8ad8ec241df0a434aa3d8c643 (patch)
tree67f46ba5969bd13cc8fc9ae4f7be7c09ce9dfbcb
parent9fc518192eecb53110c08726b85cc616d9264cf8 (diff)
mmc: core: Exit clock scaling prior to removing the card
After removing the SD/MMC 'card' from the driver model we are cancelling the pending clock scaling work which accesses card->dev. This could cause NULL pointer issue as the card is already removed. CRs-Fixed: 640344 Change-Id: I8c5ee817e3f116dedf0bf4fb51eb6b70d52467b7 Signed-off-by: Pratibhasagar V <pratibha@codeaurora.org>
-rw-r--r--drivers/mmc/core/mmc.c3
-rw-r--r--drivers/mmc/core/sd.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 50d1eb11eaeb..351fc78d0d7c 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1908,11 +1908,12 @@ static void mmc_remove(struct mmc_host *host)
BUG_ON(!host->card);
unregister_reboot_notifier(&host->card->reboot_notify);
+
+ mmc_exit_clk_scaling(host);
mmc_remove_card(host->card);
mmc_claim_host(host);
host->card = NULL;
- mmc_exit_clk_scaling(host);
mmc_release_host(host);
}
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index 165b6f2b729e..092b447ae901 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -1119,11 +1119,11 @@ static void mmc_sd_remove(struct mmc_host *host)
BUG_ON(!host);
BUG_ON(!host->card);
+ mmc_exit_clk_scaling(host);
mmc_remove_card(host->card);
mmc_claim_host(host);
host->card = NULL;
- mmc_exit_clk_scaling(host);
mmc_release_host(host);
}