]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
use calloc() instead of malloc() to get memory initialized to zero
authorLothar Waßmann <LW@KARO-electronics.de>
Tue, 20 Mar 2012 11:11:22 +0000 (12:11 +0100)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 20 Mar 2012 11:11:22 +0000 (12:11 +0100)
drivers/mmc/mxsmmc.c

index cac2312de9dfeadea2284c03134d56da832ec90e..c0e8e0a31ba564b588ca68d463925ea5080c9dac 100644 (file)
@@ -290,11 +290,11 @@ int mxsmmc_initialize(bd_t *bis, int id, int (*wp)(int))
        struct mmc *mmc = NULL;
        struct mxsmmc_priv *priv = NULL;
 
-       mmc = malloc(sizeof(struct mmc));
+       mmc = calloc(sizeof(struct mmc), 1);
        if (!mmc)
                return -ENOMEM;
 
-       priv = malloc(sizeof(struct mxsmmc_priv));
+       priv = calloc(sizeof(struct mxsmmc_priv), 1);
        if (!priv) {
                free(mmc);
                return -ENOMEM;