Replace kmalloc+memset with kzalloc 

Signed-off-by: Yan Burman <yan_952@hotmail.com>

diff -rubp linux-2.6.19-rc5_orig/arch/ppc/platforms/ev64360.c linux-2.6.19-rc5_kzalloc/arch/ppc/platforms/ev64360.c
--- linux-2.6.19-rc5_orig/arch/ppc/platforms/ev64360.c	2006-11-09 12:16:22.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/ppc/platforms/ev64360.c	2006-11-11 22:44:04.000000000 +0200
@@ -358,13 +358,12 @@ ev64360_setup_mtd(void)
 
 	ptbl_entries = 3;
 
-	if ((ptbl = kmalloc(ptbl_entries * sizeof(struct mtd_partition),
+	if ((ptbl = kzalloc(ptbl_entries * sizeof(struct mtd_partition),
 		GFP_KERNEL)) == NULL) {
 
 		printk(KERN_WARNING "Can't alloc MTD partition table\n");
 		return -ENOMEM;
 	}
-	memset(ptbl, 0, ptbl_entries * sizeof(struct mtd_partition));
 
 	ptbl[0].name = "reserved";
 	ptbl[0].offset = 0;
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/afs.c linux-2.6.19-rc5_kzalloc/drivers/mtd/afs.c
--- linux-2.6.19-rc5_orig/drivers/mtd/afs.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/afs.c	2006-11-11 22:44:04.000000000 +0200
@@ -207,11 +207,10 @@ static int parse_afs_partitions(struct m
 	if (!sz)
 		return ret;
 
-	parts = kmalloc(sz, GFP_KERNEL);
+	parts = kzalloc(sz, GFP_KERNEL);
 	if (!parts)
 		return -ENOMEM;
 
-	memset(parts, 0, sz);
 	str = (char *)(parts + idx);
 
 	/*
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/chips/amd_flash.c linux-2.6.19-rc5_kzalloc/drivers/mtd/chips/amd_flash.c
--- linux-2.6.19-rc5_orig/drivers/mtd/chips/amd_flash.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/chips/amd_flash.c	2006-11-11 22:44:04.000000000 +0200
@@ -643,13 +643,12 @@ static struct mtd_info *amd_flash_probe(
 	int reg_idx;
 	int offset;
 
-	mtd = (struct mtd_info*)kmalloc(sizeof(*mtd), GFP_KERNEL);
+	mtd = kzalloc(sizeof(*mtd), GFP_KERNEL);
 	if (!mtd) {
 		printk(KERN_WARNING
 		       "%s: kmalloc failed for info structure\n", map->name);
 		return NULL;
 	}
-	memset(mtd, 0, sizeof(*mtd));
 	mtd->priv = map;
 
 	memset(&temp, 0, sizeof(temp));
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/chips/cfi_cmdset_0001.c linux-2.6.19-rc5_kzalloc/drivers/mtd/chips/cfi_cmdset_0001.c
--- linux-2.6.19-rc5_orig/drivers/mtd/chips/cfi_cmdset_0001.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/chips/cfi_cmdset_0001.c	2006-11-11 22:44:04.000000000 +0200
@@ -337,12 +337,11 @@ struct mtd_info *cfi_cmdset_0001(struct 
 	struct mtd_info *mtd;
 	int i;
 
-	mtd = kmalloc(sizeof(*mtd), GFP_KERNEL);
+	mtd = kzalloc(sizeof(*mtd), GFP_KERNEL);
 	if (!mtd) {
 		printk(KERN_ERR "Failed to allocate memory for MTD device\n");
 		return NULL;
 	}
-	memset(mtd, 0, sizeof(*mtd));
 	mtd->priv = map;
 	mtd->type = MTD_NORFLASH;
 
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/chips/cfi_cmdset_0002.c linux-2.6.19-rc5_kzalloc/drivers/mtd/chips/cfi_cmdset_0002.c
--- linux-2.6.19-rc5_orig/drivers/mtd/chips/cfi_cmdset_0002.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/chips/cfi_cmdset_0002.c	2006-11-11 22:44:04.000000000 +0200
@@ -255,12 +255,11 @@ struct mtd_info *cfi_cmdset_0002(struct 
 	struct mtd_info *mtd;
 	int i;
 
-	mtd = kmalloc(sizeof(*mtd), GFP_KERNEL);
+	mtd = kzalloc(sizeof(*mtd), GFP_KERNEL);
 	if (!mtd) {
 		printk(KERN_WARNING "Failed to allocate memory for MTD device\n");
 		return NULL;
 	}
-	memset(mtd, 0, sizeof(*mtd));
 	mtd->priv = map;
 	mtd->type = MTD_NORFLASH;
 
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/chips/cfi_cmdset_0020.c linux-2.6.19-rc5_kzalloc/drivers/mtd/chips/cfi_cmdset_0020.c
--- linux-2.6.19-rc5_orig/drivers/mtd/chips/cfi_cmdset_0020.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/chips/cfi_cmdset_0020.c	2006-11-11 22:44:18.000000000 +0200
@@ -172,7 +172,7 @@ static struct mtd_info *cfi_staa_setup(s
 	int i,j;
 	unsigned long devsize = (1<<cfi->cfiq->DevSize) * cfi->interleave;
 
-	mtd = kmalloc(sizeof(*mtd), GFP_KERNEL);
+	mtd = kzalloc(sizeof(*mtd), GFP_KERNEL);
 	//printk(KERN_DEBUG "number of CFI chips: %d\n", cfi->numchips);
 
 	if (!mtd) {
@@ -181,7 +181,6 @@ static struct mtd_info *cfi_staa_setup(s
 		return NULL;
 	}
 
-	memset(mtd, 0, sizeof(*mtd));
 	mtd->priv = map;
 	mtd->type = MTD_NORFLASH;
 	mtd->size = devsize * cfi->numchips;
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/chips/gen_probe.c linux-2.6.19-rc5_kzalloc/drivers/mtd/chips/gen_probe.c
--- linux-2.6.19-rc5_orig/drivers/mtd/chips/gen_probe.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/chips/gen_probe.c	2006-11-11 22:44:04.000000000 +0200
@@ -113,13 +113,12 @@ static struct cfi_private *genprobe_iden
 	}
 
 	mapsize = (max_chips + BITS_PER_LONG-1) / BITS_PER_LONG;
-	chip_map = kmalloc(mapsize, GFP_KERNEL);
+	chip_map = kzalloc(mapsize, GFP_KERNEL);
 	if (!chip_map) {
 		printk(KERN_WARNING "%s: kmalloc failed for CFI chip map\n", map->name);
 		kfree(cfi.cfiq);
 		return NULL;
 	}
-	memset (chip_map, 0, mapsize);
 
 	set_bit(0, chip_map); /* Mark first chip valid */
 
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/chips/jedec.c linux-2.6.19-rc5_kzalloc/drivers/mtd/chips/jedec.c
--- linux-2.6.19-rc5_orig/drivers/mtd/chips/jedec.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/chips/jedec.c	2006-11-11 22:44:04.000000000 +0200
@@ -116,11 +116,10 @@ static struct mtd_info *jedec_probe(stru
    char Part[200];
    memset(&priv,0,sizeof(priv));
 
-   MTD = kmalloc(sizeof(struct mtd_info) + sizeof(struct jedec_private), GFP_KERNEL);
+   MTD = kzalloc(sizeof(struct mtd_info) + sizeof(struct jedec_private), GFP_KERNEL);
    if (!MTD)
 	   return NULL;
 
-   memset(MTD, 0, sizeof(struct mtd_info) + sizeof(struct jedec_private));
    priv = (struct jedec_private *)&MTD[1];
 
    my_bank_size = map->size;
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/chips/map_absent.c linux-2.6.19-rc5_kzalloc/drivers/mtd/chips/map_absent.c
--- linux-2.6.19-rc5_orig/drivers/mtd/chips/map_absent.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/chips/map_absent.c	2006-11-11 22:44:04.000000000 +0200
@@ -47,13 +47,11 @@ static struct mtd_info *map_absent_probe
 {
 	struct mtd_info *mtd;
 
-	mtd = kmalloc(sizeof(*mtd), GFP_KERNEL);
+	mtd = kzalloc(sizeof(*mtd), GFP_KERNEL);
 	if (!mtd) {
 		return NULL;
 	}
 
-	memset(mtd, 0, sizeof(*mtd));
-
 	map->fldrv 	= &map_absent_chipdrv;
 	mtd->priv 	= map;
 	mtd->name 	= map->name;
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/chips/map_ram.c linux-2.6.19-rc5_kzalloc/drivers/mtd/chips/map_ram.c
--- linux-2.6.19-rc5_orig/drivers/mtd/chips/map_ram.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/chips/map_ram.c	2006-11-11 22:44:04.000000000 +0200
@@ -55,12 +55,10 @@ static struct mtd_info *map_ram_probe(st
 #endif
 	/* OK. It seems to be RAM. */
 
-	mtd = kmalloc(sizeof(*mtd), GFP_KERNEL);
+	mtd = kzalloc(sizeof(*mtd), GFP_KERNEL);
 	if (!mtd)
 		return NULL;
 
-	memset(mtd, 0, sizeof(*mtd));
-
 	map->fldrv = &mapram_chipdrv;
 	mtd->priv = map;
 	mtd->name = map->name;
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/chips/map_rom.c linux-2.6.19-rc5_kzalloc/drivers/mtd/chips/map_rom.c
--- linux-2.6.19-rc5_orig/drivers/mtd/chips/map_rom.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/chips/map_rom.c	2006-11-11 22:44:04.000000000 +0200
@@ -31,12 +31,10 @@ static struct mtd_info *map_rom_probe(st
 {
 	struct mtd_info *mtd;
 
-	mtd = kmalloc(sizeof(*mtd), GFP_KERNEL);
+	mtd = kzalloc(sizeof(*mtd), GFP_KERNEL);
 	if (!mtd)
 		return NULL;
 
-	memset(mtd, 0, sizeof(*mtd));
-
 	map->fldrv = &maprom_chipdrv;
 	mtd->priv = map;
 	mtd->name = map->name;
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/chips/sharp.c linux-2.6.19-rc5_kzalloc/drivers/mtd/chips/sharp.c
--- linux-2.6.19-rc5_orig/drivers/mtd/chips/sharp.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/chips/sharp.c	2006-11-11 22:44:32.000000000 +0200
@@ -112,18 +112,16 @@ static struct mtd_info *sharp_probe(stru
 	struct sharp_info *sharp = NULL;
 	int width;
 
-	mtd = kmalloc(sizeof(*mtd), GFP_KERNEL);
+	mtd = kzalloc(sizeof(*mtd), GFP_KERNEL);
 	if(!mtd)
 		return NULL;
 
-	sharp = kmalloc(sizeof(*sharp), GFP_KERNEL);
+	sharp = kzalloc(sizeof(*sharp), GFP_KERNEL);
 	if(!sharp) {
 		kfree(mtd);
 		return NULL;
 	}
 
-	memset(mtd, 0, sizeof(*mtd));
-
 	width = sharp_probe_map(map,mtd);
 	if(!width){
 		kfree(mtd);
@@ -143,7 +141,6 @@ static struct mtd_info *sharp_probe(stru
 	mtd->writesize = 1;
 	mtd->name = map->name;
 
-	memset(sharp, 0, sizeof(*sharp));
 	sharp->chipshift = 23;
 	sharp->numchips = 1;
 	sharp->chips[0].start = 0;
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/cmdlinepart.c linux-2.6.19-rc5_kzalloc/drivers/mtd/cmdlinepart.c
--- linux-2.6.19-rc5_orig/drivers/mtd/cmdlinepart.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/cmdlinepart.c	2006-11-11 22:44:04.000000000 +0200
@@ -163,13 +163,12 @@ static struct mtd_partition * newpart(ch
 		*num_parts = this_part + 1;
 		alloc_size = *num_parts * sizeof(struct mtd_partition) +
 			     extra_mem_size;
-		parts = kmalloc(alloc_size, GFP_KERNEL);
+		parts = kzalloc(alloc_size, GFP_KERNEL);
 		if (!parts)
 		{
 			printk(KERN_ERR ERRP "out of memory\n");
 			return NULL;
 		}
-		memset(parts, 0, alloc_size);
 		extra_mem = (unsigned char *)(parts + *num_parts);
 	}
 	/* enter this partition (offset will be calculated later if it is zero at this point) */
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/devices/block2mtd.c linux-2.6.19-rc5_kzalloc/drivers/mtd/devices/block2mtd.c
--- linux-2.6.19-rc5_orig/drivers/mtd/devices/block2mtd.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/devices/block2mtd.c	2006-11-11 22:44:04.000000000 +0200
@@ -295,10 +295,9 @@ static struct block2mtd_dev *add_device(
 	if (!devname)
 		return NULL;
 
-	dev = kmalloc(sizeof(struct block2mtd_dev), GFP_KERNEL);
+	dev = kzalloc(sizeof(struct block2mtd_dev), GFP_KERNEL);
 	if (!dev)
 		return NULL;
-	memset(dev, 0, sizeof(*dev));
 
 	/* Get a handle on the device */
 	bdev = open_bdev_excl(devname, O_RDWR, NULL);
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/devices/ms02-nv.c linux-2.6.19-rc5_kzalloc/drivers/mtd/devices/ms02-nv.c
--- linux-2.6.19-rc5_orig/drivers/mtd/devices/ms02-nv.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/devices/ms02-nv.c	2006-11-11 22:44:04.000000000 +0200
@@ -131,11 +131,10 @@ static int __init ms02nv_init_one(ulong 
 	int ret = -ENODEV;
 
 	/* The module decodes 8MiB of address space. */
-	mod_res = kmalloc(sizeof(*mod_res), GFP_KERNEL);
+	mod_res = kzalloc(sizeof(*mod_res), GFP_KERNEL);
 	if (!mod_res)
 		return -ENOMEM;
 
-	memset(mod_res, 0, sizeof(*mod_res));
 	mod_res->name = ms02nv_name;
 	mod_res->start = addr;
 	mod_res->end = addr + MS02NV_SLOT_SIZE - 1;
@@ -153,24 +152,21 @@ static int __init ms02nv_init_one(ulong 
 	}
 
 	ret = -ENOMEM;
-	mtd = kmalloc(sizeof(*mtd), GFP_KERNEL);
+	mtd = kzalloc(sizeof(*mtd), GFP_KERNEL);
 	if (!mtd)
 		goto err_out_mod_res_rel;
-	memset(mtd, 0, sizeof(*mtd));
-	mp = kmalloc(sizeof(*mp), GFP_KERNEL);
+	mp = kzalloc(sizeof(*mp), GFP_KERNEL);
 	if (!mp)
 		goto err_out_mtd;
-	memset(mp, 0, sizeof(*mp));
 
 	mtd->priv = mp;
 	mp->resource.module = mod_res;
 
 	/* Firmware's diagnostic NVRAM area. */
-	diag_res = kmalloc(sizeof(*diag_res), GFP_KERNEL);
+	diag_res = kzalloc(sizeof(*diag_res), GFP_KERNEL);
 	if (!diag_res)
 		goto err_out_mp;
 
-	memset(diag_res, 0, sizeof(*diag_res));
 	diag_res->name = ms02nv_res_diag_ram;
 	diag_res->start = addr;
 	diag_res->end = addr + MS02NV_RAM - 1;
@@ -180,11 +176,10 @@ static int __init ms02nv_init_one(ulong 
 	mp->resource.diag_ram = diag_res;
 
 	/* User-available general-purpose NVRAM area. */
-	user_res = kmalloc(sizeof(*user_res), GFP_KERNEL);
+	user_res = kzalloc(sizeof(*user_res), GFP_KERNEL);
 	if (!user_res)
 		goto err_out_diag_res;
 
-	memset(user_res, 0, sizeof(*user_res));
 	user_res->name = ms02nv_res_user_ram;
 	user_res->start = addr + MS02NV_RAM;
 	user_res->end = addr + size - 1;
@@ -194,11 +189,10 @@ static int __init ms02nv_init_one(ulong 
 	mp->resource.user_ram = user_res;
 
 	/* Control and status register. */
-	csr_res = kmalloc(sizeof(*csr_res), GFP_KERNEL);
+	csr_res = kzalloc(sizeof(*csr_res), GFP_KERNEL);
 	if (!csr_res)
 		goto err_out_user_res;
 
-	memset(csr_res, 0, sizeof(*csr_res));
 	csr_res->name = ms02nv_res_csr;
 	csr_res->start = addr + MS02NV_CSR;
 	csr_res->end = addr + MS02NV_CSR + 3;
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/devices/phram.c linux-2.6.19-rc5_kzalloc/drivers/mtd/devices/phram.c
--- linux-2.6.19-rc5_orig/drivers/mtd/devices/phram.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/devices/phram.c	2006-11-11 22:44:04.000000000 +0200
@@ -126,12 +126,10 @@ static int register_device(char *name, u
 	struct phram_mtd_list *new;
 	int ret = -ENOMEM;
 
-	new = kmalloc(sizeof(*new), GFP_KERNEL);
+	new = kzalloc(sizeof(*new), GFP_KERNEL);
 	if (!new)
 		goto out0;
 
-	memset(new, 0, sizeof(*new));
-
 	ret = -EIO;
 	new->mtd.priv = ioremap(start, len);
 	if (!new->mtd.priv) {
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/devices/slram.c linux-2.6.19-rc5_kzalloc/drivers/mtd/devices/slram.c
--- linux-2.6.19-rc5_orig/drivers/mtd/devices/slram.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/devices/slram.c	2006-11-11 22:44:18.000000000 +0200
@@ -168,19 +168,16 @@ static int register_device(char *name, u
 		E("slram: Cannot allocate new MTD device.\n");
 		return(-ENOMEM);
 	}
-	(*curmtd)->mtdinfo = kmalloc(sizeof(struct mtd_info), GFP_KERNEL);
+	(*curmtd)->mtdinfo = kzalloc(sizeof(struct mtd_info), GFP_KERNEL);
 	(*curmtd)->next = NULL;
 
 	if ((*curmtd)->mtdinfo)	{
-		memset((char *)(*curmtd)->mtdinfo, 0, sizeof(struct mtd_info));
 		(*curmtd)->mtdinfo->priv =
-			kmalloc(sizeof(slram_priv_t), GFP_KERNEL);
+			kzalloc(sizeof(slram_priv_t), GFP_KERNEL);
 
 		if (!(*curmtd)->mtdinfo->priv) {
 			kfree((*curmtd)->mtdinfo);
 			(*curmtd)->mtdinfo = NULL;
-		} else {
-			memset((*curmtd)->mtdinfo->priv,0,sizeof(slram_priv_t));
 		}
 	}
 
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/ftl.c linux-2.6.19-rc5_kzalloc/drivers/mtd/ftl.c
--- linux-2.6.19-rc5_orig/drivers/mtd/ftl.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/ftl.c	2006-11-11 22:44:18.000000000 +0200
@@ -1033,7 +1033,7 @@ static void ftl_add_mtd(struct mtd_blktr
 {
 	partition_t *partition;
 
-	partition = kmalloc(sizeof(partition_t), GFP_KERNEL);
+	partition = kzalloc(sizeof(partition_t), GFP_KERNEL);
 
 	if (!partition) {
 		printk(KERN_WARNING "No memory to scan for FTL on %s\n",
@@ -1041,8 +1041,6 @@ static void ftl_add_mtd(struct mtd_blktr
 		return;
 	}
 
-	memset(partition, 0, sizeof(partition_t));
-
 	partition->mbd.mtd = mtd;
 
 	if ((scan_header(partition) == 0) &&
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/inftlcore.c linux-2.6.19-rc5_kzalloc/drivers/mtd/inftlcore.c
--- linux-2.6.19-rc5_orig/drivers/mtd/inftlcore.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/inftlcore.c	2006-11-11 22:44:04.000000000 +0200
@@ -67,13 +67,12 @@ static void inftl_add_mtd(struct mtd_blk
 
 	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: add_mtd for %s\n", mtd->name);
 
-	inftl = kmalloc(sizeof(*inftl), GFP_KERNEL);
+	inftl = kzalloc(sizeof(*inftl), GFP_KERNEL);
 
 	if (!inftl) {
 		printk(KERN_WARNING "INFTL: Out of memory for data structures\n");
 		return;
 	}
-	memset(inftl, 0, sizeof(*inftl));
 
 	inftl->mbd.mtd = mtd;
 	inftl->mbd.devnum = -1;
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/maps/ceiva.c linux-2.6.19-rc5_kzalloc/drivers/mtd/maps/ceiva.c
--- linux-2.6.19-rc5_orig/drivers/mtd/maps/ceiva.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/maps/ceiva.c	2006-11-11 22:44:04.000000000 +0200
@@ -122,10 +122,9 @@ static int __init clps_setup_mtd(struct 
 	/*
 	 * Allocate the map_info structs in one go.
 	 */
-	maps = kmalloc(sizeof(struct map_info) * nr, GFP_KERNEL);
+	maps = kzalloc(sizeof(struct map_info) * nr, GFP_KERNEL);
 	if (!maps)
 		return -ENOMEM;
-	memset(maps, 0, sizeof(struct map_info) * nr);
 	/*
 	 * Claim and then map the memory regions.
 	 */
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/maps/integrator-flash.c linux-2.6.19-rc5_kzalloc/drivers/mtd/maps/integrator-flash.c
--- linux-2.6.19-rc5_orig/drivers/mtd/maps/integrator-flash.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/maps/integrator-flash.c	2006-11-11 22:44:04.000000000 +0200
@@ -75,14 +75,12 @@ static int armflash_probe(struct platfor
 	int err;
 	void __iomem *base;
 
-	info = kmalloc(sizeof(struct armflash_info), GFP_KERNEL);
+	info = kzalloc(sizeof(struct armflash_info), GFP_KERNEL);
 	if (!info) {
 		err = -ENOMEM;
 		goto out;
 	}
 
-	memset(info, 0, sizeof(struct armflash_info));
-
 	info->plat = plat;
 	if (plat && plat->init) {
 		err = plat->init();
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/maps/omap_nor.c linux-2.6.19-rc5_kzalloc/drivers/mtd/maps/omap_nor.c
--- linux-2.6.19-rc5_orig/drivers/mtd/maps/omap_nor.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/maps/omap_nor.c	2006-11-11 22:44:04.000000000 +0200
@@ -78,12 +78,10 @@ static int __devinit omapflash_probe(str
 	struct resource *res = pdev->resource;
 	unsigned long size = res->end - res->start + 1;
 
-	info = kmalloc(sizeof(struct omapflash_info), GFP_KERNEL);
+	info = kzalloc(sizeof(struct omapflash_info), GFP_KERNEL);
 	if (!info)
 		return -ENOMEM;
 
-	memset(info, 0, sizeof(struct omapflash_info));
-
 	if (!request_mem_region(res->start, size, "flash")) {
 		err = -EBUSY;
 		goto out_free_info;
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/maps/pcmciamtd.c linux-2.6.19-rc5_kzalloc/drivers/mtd/maps/pcmciamtd.c
--- linux-2.6.19-rc5_orig/drivers/mtd/maps/pcmciamtd.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/maps/pcmciamtd.c	2006-11-11 22:44:04.000000000 +0200
@@ -735,11 +735,10 @@ static int pcmciamtd_probe(struct pcmcia
 	struct pcmciamtd_dev *dev;
 
 	/* Create new memory card device */
-	dev = kmalloc(sizeof(*dev), GFP_KERNEL);
+	dev = kzalloc(sizeof(*dev), GFP_KERNEL);
 	if (!dev) return -ENOMEM;
 	DEBUG(1, "dev=0x%p", dev);
 
-	memset(dev, 0, sizeof(*dev));
 	dev->p_dev = link;
 	link->priv = dev;
 
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/maps/physmap.c linux-2.6.19-rc5_kzalloc/drivers/mtd/maps/physmap.c
--- linux-2.6.19-rc5_orig/drivers/mtd/maps/physmap.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/maps/physmap.c	2006-11-11 22:44:04.000000000 +0200
@@ -92,12 +92,11 @@ static int physmap_flash_probe(struct pl
 	    (unsigned long long)dev->resource->end - dev->resource->start + 1,
 	    (unsigned long long)dev->resource->start);
 
-	info = kmalloc(sizeof(struct physmap_flash_info), GFP_KERNEL);
+	info = kzalloc(sizeof(struct physmap_flash_info), GFP_KERNEL);
 	if (info == NULL) {
 		err = -ENOMEM;
 		goto err_out;
 	}
-	memset(info, 0, sizeof(*info));
 
 	platform_set_drvdata(dev, info);
 
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/maps/plat-ram.c linux-2.6.19-rc5_kzalloc/drivers/mtd/maps/plat-ram.c
--- linux-2.6.19-rc5_orig/drivers/mtd/maps/plat-ram.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/maps/plat-ram.c	2006-11-11 22:44:04.000000000 +0200
@@ -147,14 +147,13 @@ static int platram_probe(struct platform
 
 	pdata = pdev->dev.platform_data;
 
-	info = kmalloc(sizeof(*info), GFP_KERNEL);
+	info = kzalloc(sizeof(*info), GFP_KERNEL);
 	if (info == NULL) {
 		dev_err(&pdev->dev, "no memory for flash info\n");
 		err = -ENOMEM;
 		goto exit_error;
 	}
 
-	memset(info, 0, sizeof(*info));
 	platform_set_drvdata(pdev, info);
 
 	info->dev = &pdev->dev;
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/maps/sa1100-flash.c linux-2.6.19-rc5_kzalloc/drivers/mtd/maps/sa1100-flash.c
--- linux-2.6.19-rc5_orig/drivers/mtd/maps/sa1100-flash.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/maps/sa1100-flash.c	2006-11-11 22:44:04.000000000 +0200
@@ -273,14 +273,12 @@ sa1100_setup_mtd(struct platform_device 
 	/*
 	 * Allocate the map_info structs in one go.
 	 */
-	info = kmalloc(size, GFP_KERNEL);
+	info = kzalloc(size, GFP_KERNEL);
 	if (!info) {
 		ret = -ENOMEM;
 		goto out;
 	}
 
-	memset(info, 0, size);
-
 	if (plat->init) {
 		ret = plat->init();
 		if (ret)
--- linux-2.6.19-rc5_orig/drivers/mtd/maps/tqm834x.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/maps/tqm834x.c	2006-11-15 20:24:26.000000000 +0200
@@ -132,20 +132,16 @@ static int __init init_tqm834x_mtd(void)
 
 		pr_debug("%s: chip probing count %d\n", __FUNCTION__, idx);
 
-		map_banks[idx] =
-			(struct map_info *)kmalloc(sizeof(struct map_info),
-						   GFP_KERNEL);
+		map_banks[idx] = kzalloc(sizeof(struct map_info), GFP_KERNEL);
 		if (map_banks[idx] == NULL) {
 			ret = -ENOMEM;
 			goto error_mem;
 		}
-		memset((void *)map_banks[idx], 0, sizeof(struct map_info));
-		map_banks[idx]->name = (char *)kmalloc(16, GFP_KERNEL);
+		map_banks[idx]->name = kzalloc(16, GFP_KERNEL);
 		if (map_banks[idx]->name == NULL) {
 			ret = -ENOMEM;
 			goto error_mem;
 		}
-		memset((void *)map_banks[idx]->name, 0, 16);
 
 		sprintf(map_banks[idx]->name, "TQM834x-%d", idx);
 		map_banks[idx]->size = flash_size;
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/maps/tqm8xxl.c linux-2.6.19-rc5_kzalloc/drivers/mtd/maps/tqm8xxl.c
--- linux-2.6.19-rc5_orig/drivers/mtd/maps/tqm8xxl.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/maps/tqm8xxl.c	2006-11-11 22:44:04.000000000 +0200
@@ -134,14 +134,13 @@ int __init init_tqm_mtd(void)
 
 		printk(KERN_INFO "%s: chip probing count %d\n", __FUNCTION__, idx);
 
-		map_banks[idx] = (struct map_info *)kmalloc(sizeof(struct map_info), GFP_KERNEL);
+		map_banks[idx] = kzalloc(sizeof(struct map_info), GFP_KERNEL);
 		if(map_banks[idx] == NULL) {
 			ret = -ENOMEM;
 			/* FIXME: What if some MTD devices were probed already? */
 			goto error_mem;
 		}
 
-		memset((void *)map_banks[idx], 0, sizeof(struct map_info));
 		map_banks[idx]->name = (char *)kmalloc(16, GFP_KERNEL);
 
 		if (!map_banks[idx]->name) {
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/mtd_blkdevs.c linux-2.6.19-rc5_kzalloc/drivers/mtd/mtd_blkdevs.c
--- linux-2.6.19-rc5_orig/drivers/mtd/mtd_blkdevs.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/mtd_blkdevs.c	2006-11-11 22:44:04.000000000 +0200
@@ -372,12 +372,10 @@ int register_mtd_blktrans(struct mtd_blk
 	if (!blktrans_notifier.list.next)
 		register_mtd_user(&blktrans_notifier);
 
-	tr->blkcore_priv = kmalloc(sizeof(*tr->blkcore_priv), GFP_KERNEL);
+	tr->blkcore_priv = kzalloc(sizeof(*tr->blkcore_priv), GFP_KERNEL);
 	if (!tr->blkcore_priv)
 		return -ENOMEM;
 
-	memset(tr->blkcore_priv, 0, sizeof(*tr->blkcore_priv));
-
 	mutex_lock(&mtd_table_mutex);
 
 	ret = register_blkdev(tr->major, tr->name);
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/mtdblock.c linux-2.6.19-rc5_kzalloc/drivers/mtd/mtdblock.c
--- linux-2.6.19-rc5_orig/drivers/mtd/mtdblock.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/mtdblock.c	2006-11-11 22:44:04.000000000 +0200
@@ -278,11 +278,10 @@ static int mtdblock_open(struct mtd_blkt
 	}
 
 	/* OK, it's not open. Create cache info for it */
-	mtdblk = kmalloc(sizeof(struct mtdblk_dev), GFP_KERNEL);
+	mtdblk = kzalloc(sizeof(struct mtdblk_dev), GFP_KERNEL);
 	if (!mtdblk)
 		return -ENOMEM;
 
-	memset(mtdblk, 0, sizeof(*mtdblk));
 	mtdblk->count = 1;
 	mtdblk->mtd = mtd;
 
@@ -339,13 +338,11 @@ static int mtdblock_flush(struct mtd_blk
 
 static void mtdblock_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
 {
-	struct mtd_blktrans_dev *dev = kmalloc(sizeof(*dev), GFP_KERNEL);
+	struct mtd_blktrans_dev *dev = kzalloc(sizeof(*dev), GFP_KERNEL);
 
 	if (!dev)
 		return;
 
-	memset(dev, 0, sizeof(*dev));
-
 	dev->mtd = mtd;
 	dev->devnum = mtd->index;
 	dev->blksize = 512;
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/mtdblock_ro.c linux-2.6.19-rc5_kzalloc/drivers/mtd/mtdblock_ro.c
--- linux-2.6.19-rc5_orig/drivers/mtd/mtdblock_ro.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/mtdblock_ro.c	2006-11-11 22:44:04.000000000 +0200
@@ -33,13 +33,11 @@ static int mtdblock_writesect(struct mtd
 
 static void mtdblock_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
 {
-	struct mtd_blktrans_dev *dev = kmalloc(sizeof(*dev), GFP_KERNEL);
+	struct mtd_blktrans_dev *dev = kzalloc(sizeof(*dev), GFP_KERNEL);
 
 	if (!dev)
 		return;
 
-	memset(dev, 0, sizeof(*dev));
-
 	dev->mtd = mtd;
 	dev->devnum = mtd->index;
 	dev->blksize = 512;
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/mtdchar.c linux-2.6.19-rc5_kzalloc/drivers/mtd/mtdchar.c
--- linux-2.6.19-rc5_orig/drivers/mtd/mtdchar.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/mtdchar.c	2006-11-11 22:44:18.000000000 +0200
@@ -431,7 +431,7 @@ static int mtd_ioctl(struct inode *inode
 		if(!(file->f_mode & 2))
 			return -EPERM;
 
-		erase=kmalloc(sizeof(struct erase_info),GFP_KERNEL);
+		erase=kzalloc(sizeof(struct erase_info),GFP_KERNEL);
 		if (!erase)
 			ret = -ENOMEM;
 		else {
@@ -440,7 +440,6 @@ static int mtd_ioctl(struct inode *inode
 
 			init_waitqueue_head(&waitq);
 
-			memset (erase,0,sizeof(struct erase_info));
 			if (copy_from_user(&erase->addr, argp,
 				    sizeof(struct erase_info_user))) {
 				kfree(erase);
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/mtdconcat.c linux-2.6.19-rc5_kzalloc/drivers/mtd/mtdconcat.c
--- linux-2.6.19-rc5_orig/drivers/mtd/mtdconcat.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/mtdconcat.c	2006-11-11 22:44:04.000000000 +0200
@@ -699,14 +699,13 @@ struct mtd_info *mtd_concat_create(struc
 
 	/* allocate the device structure */
 	size = SIZEOF_STRUCT_MTD_CONCAT(num_devs);
-	concat = kmalloc(size, GFP_KERNEL);
+	concat = kzalloc(size, GFP_KERNEL);
 	if (!concat) {
 		printk
 		    ("memory allocation error while creating concatenated device \"%s\"\n",
 		     name);
 		return NULL;
 	}
-	memset(concat, 0, size);
 	concat->subdev = (struct mtd_info **) (concat + 1);
 
 	/*
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/mtdpart.c linux-2.6.19-rc5_kzalloc/drivers/mtd/mtdpart.c
--- linux-2.6.19-rc5_orig/drivers/mtd/mtdpart.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/mtdpart.c	2006-11-11 22:44:04.000000000 +0200
@@ -323,14 +323,13 @@ int add_mtd_partitions(struct mtd_info *
 	for (i = 0; i < nbparts; i++) {
 
 		/* allocate the partition structure */
-		slave = kmalloc (sizeof(*slave), GFP_KERNEL);
+		slave = kzalloc (sizeof(*slave), GFP_KERNEL);
 		if (!slave) {
 			printk ("memory allocation error while creating partitions for \"%s\"\n",
 				master->name);
 			del_mtd_partitions(master);
 			return -ENOMEM;
 		}
-		memset(slave, 0, sizeof(*slave));
 		list_add(&slave->list, &mtd_partitions);
 
 		/* set up the MTD object for this partition */
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/nand/diskonchip.c linux-2.6.19-rc5_kzalloc/drivers/mtd/nand/diskonchip.c
--- linux-2.6.19-rc5_orig/drivers/mtd/nand/diskonchip.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/nand/diskonchip.c	2006-11-11 22:44:04.000000000 +0200
@@ -1635,13 +1635,12 @@ static int __init doc_probe(unsigned lon
 
 	len = sizeof(struct mtd_info) +
 	    sizeof(struct nand_chip) + sizeof(struct doc_priv) + (2 * sizeof(struct nand_bbt_descr));
-	mtd = kmalloc(len, GFP_KERNEL);
+	mtd = kzalloc(len, GFP_KERNEL);
 	if (!mtd) {
 		printk(KERN_ERR "DiskOnChip kmalloc (%d bytes) failed!\n", len);
 		ret = -ENOMEM;
 		goto fail;
 	}
-	memset(mtd, 0, len);
 
 	nand			= (struct nand_chip *) (mtd + 1);
 	doc			= (struct doc_priv *) (nand + 1);
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/nand/nand_bbt.c linux-2.6.19-rc5_kzalloc/drivers/mtd/nand/nand_bbt.c
--- linux-2.6.19-rc5_orig/drivers/mtd/nand/nand_bbt.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/nand/nand_bbt.c	2006-11-11 22:44:04.000000000 +0200
@@ -961,14 +961,12 @@ int nand_scan_bbt(struct mtd_info *mtd, 
 	struct nand_bbt_descr *md = this->bbt_md;
 
 	len = mtd->size >> (this->bbt_erase_shift + 2);
-	/* Allocate memory (2bit per block) */
-	this->bbt = kmalloc(len, GFP_KERNEL);
+	/* Allocate memory (2bit per block) and clear the memory bad block table */
+	this->bbt = kzalloc(len, GFP_KERNEL);
 	if (!this->bbt) {
 		printk(KERN_ERR "nand_scan_bbt: Out of memory\n");
 		return -ENOMEM;
 	}
-	/* Clear the memory bad block table */
-	memset(this->bbt, 0x00, len);
 
 	/* If no primary table decriptor is given, scan the device
 	 * to build a memory based bad block table
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/nand/nandsim.c linux-2.6.19-rc5_kzalloc/drivers/mtd/nand/nandsim.c
--- linux-2.6.19-rc5_orig/drivers/mtd/nand/nandsim.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/nand/nandsim.c	2006-11-11 22:44:04.000000000 +0200
@@ -1436,14 +1436,12 @@ static int __init ns_init_module(void)
 	}
 
 	/* Allocate and initialize mtd_info, nand_chip and nandsim structures */
-	nsmtd = kmalloc(sizeof(struct mtd_info) + sizeof(struct nand_chip)
+	nsmtd = kzalloc(sizeof(struct mtd_info) + sizeof(struct nand_chip)
 				+ sizeof(struct nandsim), GFP_KERNEL);
 	if (!nsmtd) {
 		NS_ERR("unable to allocate core structures.\n");
 		return -ENOMEM;
 	}
-	memset(nsmtd, 0, sizeof(struct mtd_info) + sizeof(struct nand_chip) +
-			sizeof(struct nandsim));
 	chip        = (struct nand_chip *)(nsmtd + 1);
         nsmtd->priv = (void *)chip;
 	nand        = (struct nandsim *)(chip + 1);
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/nftlcore.c linux-2.6.19-rc5_kzalloc/drivers/mtd/nftlcore.c
--- linux-2.6.19-rc5_orig/drivers/mtd/nftlcore.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/nftlcore.c	2006-11-11 22:44:04.000000000 +0200
@@ -57,13 +57,12 @@ static void nftl_add_mtd(struct mtd_blkt
 
 	DEBUG(MTD_DEBUG_LEVEL1, "NFTL: add_mtd for %s\n", mtd->name);
 
-	nftl = kmalloc(sizeof(struct NFTLrecord), GFP_KERNEL);
+	nftl = kzalloc(sizeof(struct NFTLrecord), GFP_KERNEL);
 
 	if (!nftl) {
 		printk(KERN_WARNING "NFTL: out of memory for data structures\n");
 		return;
 	}
-	memset(nftl, 0, sizeof(*nftl));
 
 	nftl->mbd.mtd = mtd;
 	nftl->mbd.devnum = -1;
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/onenand/generic.c linux-2.6.19-rc5_kzalloc/drivers/mtd/onenand/generic.c
--- linux-2.6.19-rc5_orig/drivers/mtd/onenand/generic.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/onenand/generic.c	2006-11-11 22:44:04.000000000 +0200
@@ -45,12 +45,10 @@ static int __devinit generic_onenand_pro
 	unsigned long size = res->end - res->start + 1;
 	int err;
 
-	info = kmalloc(sizeof(struct onenand_info), GFP_KERNEL);
+	info = kzalloc(sizeof(struct onenand_info), GFP_KERNEL);
 	if (!info)
 		return -ENOMEM;
 
-	memset(info, 0, sizeof(struct onenand_info));
-
 	if (!request_mem_region(res->start, size, dev->driver->name)) {
 		err = -EBUSY;
 		goto out_free_info;
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/onenand/onenand_bbt.c linux-2.6.19-rc5_kzalloc/drivers/mtd/onenand/onenand_bbt.c
--- linux-2.6.19-rc5_orig/drivers/mtd/onenand/onenand_bbt.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/onenand/onenand_bbt.c	2006-11-11 22:44:04.000000000 +0200
@@ -177,14 +177,12 @@ int onenand_scan_bbt(struct mtd_info *mt
 	int len, ret = 0;
 
 	len = mtd->size >> (this->erase_shift + 2);
-	/* Allocate memory (2bit per block) */
-	bbm->bbt = kmalloc(len, GFP_KERNEL);
+	/* Allocate memory (2bit per block) and clear the memory bad block table */
+	bbm->bbt = kzalloc(len, GFP_KERNEL);
 	if (!bbm->bbt) {
 		printk(KERN_ERR "onenand_scan_bbt: Out of memory\n");
 		return -ENOMEM;
 	}
-	/* Clear the memory bad block table */
-	memset(bbm->bbt, 0x00, len);
 
 	/* Set the bad block position */
 	bbm->badblockpos = ONENAND_BADBLOCK_POS;
@@ -230,14 +228,12 @@ int onenand_default_bbt(struct mtd_info 
 	struct onenand_chip *this = mtd->priv;
 	struct bbm_info *bbm;
 
-	this->bbm = kmalloc(sizeof(struct bbm_info), GFP_KERNEL);
+	this->bbm = kzalloc(sizeof(struct bbm_info), GFP_KERNEL);
 	if (!this->bbm)
 		return -ENOMEM;
 
 	bbm = this->bbm;
 
-	memset(bbm, 0, sizeof(struct bbm_info));
-
 	/* 1KB page has same configuration as 2KB page */
 	if (!bbm->badblock_pattern)
 		bbm->badblock_pattern = &largepage_memorybased;
diff -rubp linux-2.6.19-rc5_orig/drivers/mtd/redboot.c linux-2.6.19-rc5_kzalloc/drivers/mtd/redboot.c
--- linux-2.6.19-rc5_orig/drivers/mtd/redboot.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/mtd/redboot.c	2006-11-11 22:44:04.000000000 +0200
@@ -165,15 +165,13 @@ static int parse_redboot_partitions(stru
 		}
 	}
 #endif
-	parts = kmalloc(sizeof(*parts)*nrparts + nulllen + namelen, GFP_KERNEL);
+	parts = kzalloc(sizeof(*parts)*nrparts + nulllen + namelen, GFP_KERNEL);
 
 	if (!parts) {
 		ret = -ENOMEM;
 		goto out;
 	}
 
-	memset(parts, 0, sizeof(*parts)*nrparts + nulllen + namelen);
-
 	nullname = (char *)&parts[nrparts];
 #ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED
 	if (nulllen > 0) {
