]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
mmc: mxs: use calloc() to make sure the allocated memory is cleared
authorLothar Waßmann <LW@KARO-electronics.de>
Thu, 22 Aug 2013 14:37:16 +0000 (16:37 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Thu, 22 Aug 2013 14:37:16 +0000 (16:37 +0200)
drivers/mmc/mxsmmc.c

index e5a5d7532c9a918f0d08634fa09d1603b3e4eec8..6bb67bc8fbadb3af548b1f8693c82749e78ca1e9 100644 (file)
@@ -373,11 +373,11 @@ int mxsmmc_initialize(bd_t *bis, int id, int (*wp)(int), int (*cd)(int))
        if (!mxs_ssp_bus_id_valid(id))
                return -ENODEV;
 
-       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;