uboot-tools/mmc-Fix-uninitialised-priv-...

53 lines
1.8 KiB
Diff

From patchwork Fri Feb 9 15:24:38 2018
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot] mmc: Fix uninitialised priv member
X-Patchwork-Submitter: Alex Kiernan <alex.kiernan@gmail.com>
X-Patchwork-Id: 871459
X-Patchwork-Delegate: jh80.chung@samsung.com
Message-Id: <1518189878-14645-1-git-send-email-alex.kiernan@gmail.com>
To: u-boot@lists.denx.de
Date: Fri, 9 Feb 2018 15:24:38 +0000
From: Alex Kiernan <alex.kiernan@gmail.com>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
When using omap_hsmmc without the device model then the allocation
of mmc->priv ends up uninitialised.
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Tested-by: Robert Nelson <robertcnelson@gmail.com>
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
---
I've a board (AM335xx based) which boots fine with 2018-01, with
2018-03-rc1 (actually 1811a92) it fails in the MLO:
U-Boot SPL 2018.03-rc1-00222-g128a503-dirty (Feb 09 2018 - 11:51:50 +0000)
Trying to boot from MMC2
omap_hsmmc_send_cmd : DMA timeout: No status update
mmc_init: -110, time 1026
spl: mmc init failed with error: -110
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###
Bisecting it out, it's this commit:
f0d53e8 mmc: omap_hsmmc: Add support for DMA (ADMA2)
drivers/mmc/omap_hsmmc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
index b12d6d9..c6b3f25 100644
--- a/drivers/mmc/omap_hsmmc.c
+++ b/drivers/mmc/omap_hsmmc.c
@@ -918,7 +918,7 @@ int omap_mmc_init(int dev_index, uint host_caps_mask, uint f_max, int cd_gpio,
struct mmc_config *cfg;
uint host_caps_val;
- priv = malloc(sizeof(*priv));
+ priv = calloc(1, sizeof(*priv));
if (priv == NULL)
return -1;