summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSahitya Tummala <stummala@codeaurora.org>2014-04-01 14:29:13 +0530
committerSubhash Jadavani <subhashj@codeaurora.org>2016-05-27 10:29:05 -0700
commit80a4d5b5a503b6ce32bb0fe0764807d75c5a68ee (patch)
treeeff616cd0e00c5945f731204ef59295805d6a027
parent1eb54465509ed12c1684dd107971fffddfb7ca3b (diff)
mmc: sdhci-msm: fix issue with SD card tuning functionality
The commit 'e2598c - mmc: sdhci-msm: improve tuning process' introduces NULL pointer dereference bug for SD 3.0 cards when all the tuning phases pass. It uses mmc_card_mmc(card) for checking the card type but card is initialized after tuning is done for SD card and thus resulting in NULL pointer dereference issue. CRs-fixed: 640424 Change-Id: I59a8d5f017243d8391269bc98998bb37fc44f685 Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
-rw-r--r--drivers/mmc/host/sdhci-msm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
index 4d1d9c326a19..bcb637263a1f 100644
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -974,7 +974,8 @@ retry:
}
} while (++phase < 16);
- if ((tuned_phase_cnt == NUM_TUNING_PHASES) && mmc_card_mmc(card)) {
+ if ((tuned_phase_cnt == NUM_TUNING_PHASES) &&
+ card && mmc_card_mmc(card)) {
/*
* If all phases pass then its a problem. So change the card's
* drive type to a different value, if supported and repeat