projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
59f46f4
)
mmc: fsl_esdhc: Check the result from malloc()
author
Fabio Estevam
<fabio.estevam@freescale.com>
Thu, 12 Sep 2013 13:35:52 +0000
(10:35 -0300)
committer
Stefano Babic
<sbabic@denx.de>
Fri, 20 Sep 2013 15:55:36 +0000
(17:55 +0200)
malloc can fail, so we should better check its return value before using it.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
drivers/mmc/fsl_esdhc.c
patch
|
blob
|
history
diff --git
a/drivers/mmc/fsl_esdhc.c
b/drivers/mmc/fsl_esdhc.c
index f87e647881cce82f2eac37a4fc5a4863072b82e2..a7170b49db384ff20a0276eb03312192d993f1a6 100644
(file)
--- a/
drivers/mmc/fsl_esdhc.c
+++ b/
drivers/mmc/fsl_esdhc.c
@@
-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;