u-boot/drivers/mmc
Masahiro Yamada bf9c4d1464 mmc: sdhci: fix NULL pointer access when host->ops is not set
Until recently, sdhci_ops was used only for overriding IO accessors.
(so, host->ops was not set by any drivers except bcm2835_sdhci.c)

Now, we have more optional callbacks, get_cd, set_control_reg, and
set_clock.  However, the code

    if (host->ops->get_cd)
            host->ops->get_cd(host);

... expects host->ops is set for all drivers.

Commit 5e96217f04 ("mmc: pic32_sdhci: move the code to
pic32_sdhci.c") and commit 62226b6863 ("mmc: sdhci: move the
callback function into sdhci_ops") added sdhci_ops for pic32_sdhci.c
and s5p_sdhci.c, but the other drivers still do not (need not) set
host->ops because all callbacks in sdhci_ops are optional.

host->ops must be checked to avoid the system crash caused by NULL
pointer access.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-01-13 12:17:03 +09:00
..
arm_pl180_mmci.c mmc: change the set_ios return type from void to int 2017-01-11 19:40:13 +09:00
arm_pl180_mmci.h mmc: Split mmc struct, rework mmc initialization (v2) 2014-03-24 12:58:56 +02:00
atmel_sdhci.c mmc: atmel_sdhci: Remove unnecessary clock calling 2016-10-28 18:37:15 +02:00
bcm2835_sdhci.c mmc: sdhci: use the generic error number 2016-10-10 15:23:33 +09:00
bfin_sdh.c mmc: change the set_ios return type from void to int 2017-01-11 19:40:13 +09:00
davinci_mmc.c mmc: change the set_ios return type from void to int 2017-01-11 19:40:13 +09:00
dw_mmc.c mmc: change the set_ios return type from void to int 2017-01-11 19:40:13 +09:00
exynos_dw_mmc.c mmc: dw_mmc: remove the unnecessary arguments for dwmci_setup_cfg 2016-10-10 15:23:33 +09:00
fsl_esdhc.c mmc: change the set_ios return type from void to int 2017-01-11 19:40:13 +09:00
fsl_esdhc_spl.c block: pass block dev not num to read/write/erase() 2016-01-13 21:05:18 -05:00
ftsdc010_mci.c mmc: change the set_ios return type from void to int 2017-01-11 19:40:13 +09:00
ftsdc021_sdhci.c mmc: sdhci: use the generic error number 2016-10-10 15:23:33 +09:00
gen_atmel_mci.c mmc: change the set_ios return type from void to int 2017-01-11 19:40:13 +09:00
hi6220_dw_mmc.c treewide: replace #include <asm-generic/errno.h> with <linux/errno.h> 2016-09-23 22:25:27 -04:00
Kconfig mmc: move more driver config options to Kconfig 2017-01-11 19:40:15 +09:00
kona_sdhci.c mmc: sdhci: use the generic error number 2016-10-10 15:23:33 +09:00
Makefile mmc: move more driver config options to Kconfig 2017-01-11 19:40:15 +09:00
mmc-uclass.c mmc: refactor two core functions 2016-10-28 11:02:16 +09:00
mmc.c mmc: Tinification of the mmc code 2016-12-01 13:51:57 +09:00
mmc_boot.c mmc: squash lines for immediate return 2016-09-23 17:53:44 -04:00
mmc_legacy.c mmc: Tinification of the mmc code 2016-12-01 13:51:57 +09:00
mmc_private.h dm: mmc: Support erase 2016-10-09 21:36:27 -06:00
mmc_spi.c mmc: change the set_ios return type from void to int 2017-01-11 19:40:13 +09:00
mmc_write.c dm: mmc: Support erase 2016-10-09 21:36:27 -06:00
msm_sdhci.c mmc: sdhci: use the host version value in sdhci_setup_cfg 2016-10-10 15:23:33 +09:00
mv_sdhci.c mmc: sdhci: use the generic error number 2016-10-10 15:23:33 +09:00
mvebu_mmc.c mmc: change the set_ios return type from void to int 2017-01-11 19:40:13 +09:00
mxcmmc.c mmc: change the set_ios return type from void to int 2017-01-11 19:40:13 +09:00
mxsmmc.c mmc: change the set_ios return type from void to int 2017-01-11 19:40:13 +09:00
omap_hsmmc.c mmc: change the set_ios return type from void to int 2017-01-11 19:40:13 +09:00
pci_mmc.c mmc: Fix cast for 64-bit compilation 2016-10-11 07:46:11 +09:00
pic32_sdhci.c mmc: sdhci: remove the SDHCI_QUIRK_NO_CD 2017-01-11 19:40:12 +09:00
pxa_mmc_gen.c mmc: change the set_ios return type from void to int 2017-01-11 19:40:13 +09:00
rockchip_dw_mmc.c mmc: dw_mmc: remove the unnecessary arguments for dwmci_setup_cfg 2016-10-10 15:23:33 +09:00
rockchip_sdhci.c mmc: squash lines for immediate return 2016-09-23 17:53:44 -04:00
rpmb.c Move ALLOC_CACHE_ALIGN_BUFFER() to the new memalign.h header 2015-09-11 17:15:20 -04:00
s3c_sdi.c mmc: change the set_ios return type from void to int 2017-01-11 19:40:13 +09:00
s5p_sdhci.c mmc: sdhci: move the callback function into sdhci_ops 2017-01-11 19:40:13 +09:00
sandbox_mmc.c mmc: squash lines for immediate return 2016-09-23 17:53:44 -04:00
sdhci-cadence.c mmc: sdhci-cadence: add Cadence SD4HC support 2017-01-11 19:40:14 +09:00
sdhci.c mmc: sdhci: fix NULL pointer access when host->ops is not set 2017-01-13 12:17:03 +09:00
sh_mmcif.c mmc: change the set_ios return type from void to int 2017-01-11 19:40:13 +09:00
sh_mmcif.h ARM: Rmobile: Rename CONFIG_RMOBILE to CONFIG_ARCH_RMOBILE 2016-08-17 10:25:34 +09:00
sh_sdhi.c mmc: change the set_ios return type from void to int 2017-01-11 19:40:13 +09:00
socfpga_dw_mmc.c dm: mmc: socfpga: fix MMC_OPS support 2016-10-28 11:02:16 +09:00
sunxi_mmc.c mmc: change the set_ios return type from void to int 2017-01-11 19:40:13 +09:00
tegra_mmc.c mmc: change the set_ios return type from void to int 2017-01-11 19:40:13 +09:00
uniphier-sd.c mmc: uniphier-sd: migrate to CONFIG_BLK 2016-09-14 22:54:19 +09:00
zynq_sdhci.c mmc: sdhci: use the host version value in sdhci_setup_cfg 2016-10-10 15:23:33 +09:00