diff options
author | Andrew F. Davis | 2018-11-12 11:13:43 -0600 |
---|---|---|
committer | Lokesh Vutla | 2018-11-13 09:02:57 -0600 |
commit | b1db1fb0d39fa706f0ad8e36f301aba429475bed (patch) | |
tree | 30d0413489f7a836926f5d1c9e3cb3b2ff1b0cee | |
parent | b71baaefe26ccbb83b59fa88a7e1119df8c77bd4 (diff) | |
download | u-boot-ti-u-boot-2018.01.tar.gz u-boot-ti-u-boot-2018.01.tar.xz u-boot-ti-u-boot-2018.01.zip |
mmc: arasan_sdhci: Fix host->mmc null pointer dereferenceti2018.05-rc4ti-u-boot-2018.01
The mmc structure in host is used before it is assigned,
move the assignment of host->mmc to before its first use.
Signed-off-by: Andrew F. Davis <afd@ti.com>
-rw-r--r-- | drivers/mmc/arasan_sdhci.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mmc/arasan_sdhci.c b/drivers/mmc/arasan_sdhci.c index 039a50337c..21f81f8389 100644 --- a/drivers/mmc/arasan_sdhci.c +++ b/drivers/mmc/arasan_sdhci.c | |||
@@ -259,12 +259,12 @@ static int arasan_sdhci_probe(struct udevice *dev) | |||
259 | mmc_of_parse(dev, &plat->cfg); | 259 | mmc_of_parse(dev, &plat->cfg); |
260 | 260 | ||
261 | host->max_clk = clock; | 261 | host->max_clk = clock; |
262 | host->mmc = &plat->mmc; | ||
262 | host->mmc->dev = dev; | 263 | host->mmc->dev = dev; |
263 | 264 | ||
264 | host->ops = &arasan_ops; | 265 | host->ops = &arasan_ops; |
265 | ret = sdhci_setup_cfg(&plat->cfg, host, plat->f_max, | 266 | ret = sdhci_setup_cfg(&plat->cfg, host, plat->f_max, |
266 | CONFIG_ARASAN_SDHCI_MIN_FREQ); | 267 | CONFIG_ARASAN_SDHCI_MIN_FREQ); |
267 | host->mmc = &plat->mmc; | ||
268 | if (ret) | 268 | if (ret) |
269 | return ret; | 269 | return ret; |
270 | host->mmc->priv = host; | 270 | host->mmc->priv = host; |