summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Yasman <eyasman@codeaurora.org>2014-12-04 22:07:18 +0200
committerSubhash Jadavani <subhashj@codeaurora.org>2016-05-31 15:25:49 -0700
commit954eba25460cb85a0a06c2be6055239c761d5ce9 (patch)
treebd6433c20d3f1f081582f2f8ad40a7380e61957f
parent15209ec725e499e1e53b6e1104b6249e0430bf94 (diff)
mmc: core: add checks for pointers before driver shutdown
Verify drv and card pointers before calling for driver shutdown. Change-Id: I855e32f988ec1af475df6ed91f04618525e1a59f Signed-off-by: Eugene Yasman <eyasman@codeaurora.org> [merez@codeaurora.org: fix conflicts due to changes in 3.14] Signed-off-by: Maya Erez <merez@codeaurora.org>
-rw-r--r--drivers/mmc/core/bus.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
index 483342e5dbfb..15e94c25b06e 100644
--- a/drivers/mmc/core/bus.c
+++ b/drivers/mmc/core/bus.c
@@ -132,6 +132,16 @@ static void mmc_bus_shutdown(struct device *dev)
struct mmc_host *host = card->host;
int ret;
+ if (!drv) {
+ pr_debug("%s: %s: drv is NULL\n", dev_name(dev), __func__);
+ return;
+ }
+
+ if (!card) {
+ pr_debug("%s: %s: card is NULL\n", dev_name(dev), __func__);
+ return;
+ }
+
if (dev->driver && drv->shutdown)
drv->shutdown(card);