mmc: mv_sdhci: fix uninitialized pointer deref on probe
authorBaruch Siach <baruch@tkos.co.il>
Mon, 22 Jul 2019 15:55:35 +0000 (18:55 +0300)
committerPeng Fan <peng.fan@nxp.com>
Wed, 31 Jul 2019 07:31:36 +0000 (15:31 +0800)
commit41a9fab8dac841afb70a059668abaf14d47cdf59
treeacb37f7b8d29f1702f954541b54756b17cdbda4c
parent09da18deab8b56524934c9d1050edaaf53e2e8ae
mmc: mv_sdhci: fix uninitialized pointer deref on probe

Since commit 3d296365e4e8 ("mmc: sdhci: Add support for
sdhci-caps-mask") sdhci_setup_cfg() expects a valid sdhci_host mmc
field. Move the mmc field initialization before sdhci_setup_cfg()
call to avoid crash on mmc pointer dereference.

Fixes: 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask")
Cc: Faiz Abbas <faiz_abbas@ti.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
drivers/mmc/mv_sdhci.c