Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <ulf.hansson@linaro.org>
Reported-by: Stephen Warren <swarren@wwwdotorg.org>
Reported-by: Tuomas Tynkkynen <ttynkkynen@nvidia.com>
Tested-by: Tuomas Tynkkynen <ttynkkynen@nvidia.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>

authored by

Ulf Hansson and committed by
Chris Ball
203bb5af 30d025c0

+2 -1
+2 -1
drivers/mmc/core/bus.c
··· 129 129 struct mmc_host *host = card->host; 130 130 int ret; 131 131 132 - drv->shutdown(card); 132 + if (dev->driver && drv->shutdown) 133 + drv->shutdown(card); 133 134 134 135 if (host->bus_ops->shutdown) { 135 136 ret = host->bus_ops->shutdown(host);