From e2dffecbe77a3edb2beabc5a2836c6934ed2ad46 Mon Sep 17 00:00:00 2001 From: Venkat Gopalakrishnan Date: Tue, 10 Mar 2015 14:11:28 -0700 Subject: mmc: sd: Use locally stored ocr on paranoid init Prevent null pointer dereference when accessing ocr stored in the card structure in case mmc_sd_init_card() had failed before allocating the card structure and we are retrying the init. Change-Id: I15365804e0986e01339ccaefdffdfaf9fd319160 Signed-off-by: Venkat Gopalakrishnan --- drivers/mmc/core/sd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index 092b447ae901..99b521b79f1c 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c @@ -1413,8 +1413,8 @@ int mmc_attach_sd(struct mmc_host *host) retries--; mmc_power_off(host); usleep_range(5000, 5500); - mmc_power_up(host, host->card->ocr); - mmc_select_voltage(host, host->card->ocr); + mmc_power_up(host, rocr); + mmc_select_voltage(host, rocr); continue; } break; -- cgit v1.2.3