Home
last modified time | relevance | path

Searched hist:bf9c4d146467297771a0f60bdb897be38671dba7 (Results 1 – 1 of 1) sorted by relevance

/rk3399_rockchip-uboot/drivers/mmc/
H A Dsdhci.cbf9c4d146467297771a0f60bdb897be38671dba7 Fri Jan 13 02:51:51 UTC 2017 Masahiro Yamada <yamada.masahiro@socionext.com> 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 5e96217f0434 ("mmc: pic32_sdhci: move the code to
pic32_sdhci.c") and commit 62226b68631b ("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>