From: Ulf Hansson Date: Tue, 2 Jul 2013 10:53:01 +0000 (+0200) Subject: mmc: core: Fixup Oops for SDIO shutdown X-Git-Tag: firefly_0821_release~6165^2~50 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=af98bcd3c1a9302ae21cec76cb4f731169bf80ec;p=firefly-linux-kernel-4.4.55.git mmc: core: Fixup Oops for SDIO shutdown Commit "mmc: core: Handle card shutdown from mmc_bus" introduced an Oops in the shutdown sequence for SDIO. The drv pointer, does not exist for SDIO since the probing of the SDIO card from the mmc_bus perspective is expected to fail by returning -ENODEV. This patch adds the proper check for the pointer before calling it. Signed-off-by: Ulf Hansson Reported-by: Stephen Warren Reported-by: Tuomas Tynkkynen Tested-by: Tuomas Tynkkynen Acked-by: Jaehoon Chung Signed-off-by: Chris Ball --- diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c index b9e5bea228ed..704bf66f5873 100644 --- a/drivers/mmc/core/bus.c +++ b/drivers/mmc/core/bus.c @@ -129,7 +129,8 @@ static void mmc_bus_shutdown(struct device *dev) struct mmc_host *host = card->host; int ret; - drv->shutdown(card); + if (dev->driver && drv->shutdown) + drv->shutdown(card); if (host->bus_ops->shutdown) { ret = host->bus_ops->shutdown(host);