Skip to content
Snippets Groups Projects
Commit 3f786a8b authored by Fabio Estevam's avatar Fabio Estevam Committed by Stefano Babic
Browse files

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: default avatarFabio Estevam <fabio.estevam@freescale.com>
parent 59f46f4a
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment