Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dfdb4af5 authored by Sahitya Tummala's avatar Sahitya Tummala Committed by Xiaonian Wang
Browse files

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: default avatarSahitya Tummala <stummala@codeaurora.org>
parent 96e6b110
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -976,7 +976,8 @@ int sdhci_msm_execute_tuning(struct sdhci_host *host, u32 opcode)
		}
	} 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