mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
mmc: fsl_esdhc: Check the result from malloc()
malloc can fail, so we should better check its return value before using it. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
This commit is contained in:
committed by
Stefano Babic
parent
59f46f4a73
commit
3f786a8b6f
@@ -518,6 +518,8 @@ int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg)
|
||||
return -1;
|
||||
|
||||
mmc = malloc(sizeof(struct mmc));
|
||||
if (!mmc)
|
||||
return -ENOMEM;
|
||||
|
||||
sprintf(mmc->name, "FSL_SDHC");
|
||||
regs = (struct fsl_esdhc *)cfg->esdhc_base;
|
||||
|
||||
Reference in New Issue
Block a user