Message ID | ca874be0c6eea046d82dc85d66d4665d266cf8c9.1583470026.git.nguyenb@codeaurora.org |
---|---|
State | New |
Headers | show |
Series | SD card bug fixes | expand |
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index 76c7add..f0872e3 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c @@ -989,6 +989,7 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr, err = mmc_send_relative_addr(host, &card->rca); if (err) goto free_card; + host->card = card; } if (!oldcard) { @@ -1100,12 +1101,13 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr, goto free_card; } done: - host->card = card; return 0; free_card: - if (!oldcard) + if (!oldcard) { + host->card = NULL; mmc_remove_card(card); + } return err; }