From: Lothar Waßmann Date: Fri, 21 Aug 2015 13:59:50 +0000 (+0200) Subject: mtd: nand: mxs_nand: use calloc() to allocate and clear memory X-Git-Tag: KARO-TX6-2015-09-18~4034^2^2~12 X-Git-Url: https://git.kernelconcepts.de/?p=karo-tx-uboot.git;a=commitdiff_plain;h=f9630d9461b3beae7acbdad54a47c1153b7a3724 mtd: nand: mxs_nand: use calloc() to allocate and clear memory --- diff --git a/drivers/mtd/nand/mxs_nand.c b/drivers/mtd/nand/mxs_nand.c index e424f60a9a..08847fd8e2 100644 --- a/drivers/mtd/nand/mxs_nand.c +++ b/drivers/mtd/nand/mxs_nand.c @@ -1304,12 +1304,11 @@ int board_nand_init(struct nand_chip *nand) struct mxs_nand_info *nand_info; int err; - nand_info = malloc(sizeof(struct mxs_nand_info)); + nand_info = calloc(1, sizeof(struct mxs_nand_info)); if (!nand_info) { printf("MXS NAND: Failed to allocate private data\n"); return -ENOMEM; } - memset(nand_info, 0, sizeof(struct mxs_nand_info)); err = mxs_nand_alloc_buffers(nand_info); if (err)