Message ID | b328b981a785525b8424b4ab2197dc1ec54417d1.1582839544.git.nguyenb@codeaurora.org |
---|---|
State | New |
Headers | show |
Series | SD card bug fixes | expand |
diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c index 74de3f2..4558f51 100644 --- a/drivers/mmc/core/bus.c +++ b/drivers/mmc/core/bus.c @@ -131,6 +131,11 @@ static void mmc_bus_shutdown(struct device *dev) struct mmc_host *host = card->host; int ret; + if (!card) { + dev_dbg(dev, "%s: %s: card is NULL\n", dev_name(dev), __func__); + return; + } + if (dev->driver && drv->shutdown) drv->shutdown(card); diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 6b38c19..94441a0 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -666,6 +666,9 @@ void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card) { unsigned int mult; + if (!card) + return; + /* * SDIO cards only define an upper 1 s limit on access. */