summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2019-08-06 02:48:02 +0000
committerPeng Fan <peng.fan@nxp.com>2019-08-09 13:45:25 +0800
commitd703104507a30c2b4197b2522e084ee01782d0dc (patch)
treefc34bab0ef5f077ecda7f6158d28b00fbd60c802
parent6f16cbe55be732e65e72544ff72d68acf266e359 (diff)
mmc: sdhci-cadence: fix uninitialized pointer deref on probe
Commit 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask") sdhci_setup_cfg() expects a valid sdhci_host mmc field. Fixes: 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask") Cc: Faiz Abbas <faiz_abbas@ti.com> Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-rw-r--r--drivers/mmc/sdhci-cadence.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mmc/sdhci-cadence.c b/drivers/mmc/sdhci-cadence.c
index 4f9338f733..4736263bf2 100644
--- a/drivers/mmc/sdhci-cadence.c
+++ b/drivers/mmc/sdhci-cadence.c
@@ -269,12 +269,13 @@ static int sdhci_cdns_probe(struct udevice *dev)
if (ret)
return ret;
+ host->mmc = &plat->mmc;
+ host->mmc->dev = dev;
ret = sdhci_setup_cfg(&plat->cfg, host, 0, 0);
if (ret)
return ret;
upriv->mmc = &plat->mmc;
- host->mmc = &plat->mmc;
host->mmc->priv = host;
return sdhci_probe(dev);