mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-09-25 15:51:27 +02:00
arm: stm32mp: stm32prog: check result of find_mmc_device
Check result of find_mmc_device() before calling mmc_init(). This patch avoid a data abort when the command try to acces to sd/mmc device deactivated in device tree. Fixes: aff4c5dd8265 ("stm32mp: stm32prog: add MMC device") Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
This commit is contained in:
parent
4b64265bb4
commit
ded48bec05
@ -560,7 +560,7 @@ static int init_device(struct stm32prog_data *data,
|
|||||||
#ifdef CONFIG_MMC
|
#ifdef CONFIG_MMC
|
||||||
case STM32PROG_MMC:
|
case STM32PROG_MMC:
|
||||||
mmc = find_mmc_device(dev->dev_id);
|
mmc = find_mmc_device(dev->dev_id);
|
||||||
if (mmc_init(mmc)) {
|
if (!mmc || mmc_init(mmc)) {
|
||||||
stm32prog_err("mmc device %d not found", dev->dev_id);
|
stm32prog_err("mmc device %d not found", dev->dev_id);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user