Replace kmalloc+memset with kzalloc 
Patch 2/17

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

diff -rubp linux-2.6.19-rc5_orig/arch/alpha/kernel/module.c linux-2.6.19-rc5_kzalloc/arch/alpha/kernel/module.c
--- linux-2.6.19-rc5_orig/arch/alpha/kernel/module.c	2006-11-09 12:16:22.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/alpha/kernel/module.c	2006-11-11 22:44:04.000000000 +0200
@@ -119,8 +119,7 @@ module_frob_arch_sections(Elf64_Ehdr *hd
 	}
 
 	nsyms = symtab->sh_size / sizeof(Elf64_Sym);
-	chains = kmalloc(nsyms * sizeof(struct got_entry), GFP_KERNEL);
-	memset(chains, 0, nsyms * sizeof(struct got_entry));
+	chains = kzalloc(nsyms * sizeof(struct got_entry), GFP_KERNEL);
 
 	got->sh_size = 0;
 	got->sh_addralign = 8;
diff -rubp linux-2.6.19-rc5_orig/arch/arm26/kernel/ecard.c linux-2.6.19-rc5_kzalloc/arch/arm26/kernel/ecard.c
--- linux-2.6.19-rc5_orig/arch/arm26/kernel/ecard.c	2006-11-09 12:16:22.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/arm26/kernel/ecard.c	2006-11-11 22:44:04.000000000 +0200
@@ -620,12 +620,10 @@ ecard_probe(int slot, card_type_t type)
 	struct ex_ecid cid;
 	int i, rc = -ENOMEM;
 
-	ec = kmalloc(sizeof(ecard_t), GFP_KERNEL);
+	ec = kzalloc(sizeof(ecard_t), GFP_KERNEL);
 	if (!ec)
 		goto nomem;
 
-	memset(ec, 0, sizeof(ecard_t));
-
 	ec->slot_no	= slot;
 	ec->type        = type;
 	ec->irq		= NO_IRQ;
diff -rubp linux-2.6.19-rc5_orig/arch/cris/arch-v32/drivers/pci/dma.c linux-2.6.19-rc5_kzalloc/arch/cris/arch-v32/drivers/pci/dma.c
--- linux-2.6.19-rc5_orig/arch/cris/arch-v32/drivers/pci/dma.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/cris/arch-v32/drivers/pci/dma.c	2006-11-11 22:44:04.000000000 +0200
@@ -91,14 +91,12 @@ int dma_declare_coherent_memory(struct d
 	if (!mem_base)
 		goto out;
 
-	dev->dma_mem = kmalloc(sizeof(struct dma_coherent_mem), GFP_KERNEL);
+	dev->dma_mem = kzalloc(sizeof(struct dma_coherent_mem), GFP_KERNEL);
 	if (!dev->dma_mem)
 		goto out;
-	memset(dev->dma_mem, 0, sizeof(struct dma_coherent_mem));
-	dev->dma_mem->bitmap = kmalloc(bitmap_size, GFP_KERNEL);
+	dev->dma_mem->bitmap = kzalloc(bitmap_size, GFP_KERNEL);
 	if (!dev->dma_mem->bitmap)
 		goto free1_out;
-	memset(dev->dma_mem->bitmap, 0, bitmap_size);
 
 	dev->dma_mem->virt_base = mem_base;
 	dev->dma_mem->device_base = device_addr;
diff -rubp linux-2.6.19-rc5_orig/arch/i386/kernel/cpu/intel_cacheinfo.c linux-2.6.19-rc5_kzalloc/arch/i386/kernel/cpu/intel_cacheinfo.c
--- linux-2.6.19-rc5_orig/arch/i386/kernel/cpu/intel_cacheinfo.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/i386/kernel/cpu/intel_cacheinfo.c	2006-11-11 22:44:04.000000000 +0200
@@ -480,12 +480,10 @@ static int __cpuinit detect_cache_attrib
 	if (num_cache_leaves == 0)
 		return -ENOENT;
 
-	cpuid4_info[cpu] = kmalloc(
+	cpuid4_info[cpu] = kzalloc(
 	    sizeof(struct _cpuid4_info) * num_cache_leaves, GFP_KERNEL);
 	if (unlikely(cpuid4_info[cpu] == NULL))
 		return -ENOMEM;
-	memset(cpuid4_info[cpu], 0,
-	    sizeof(struct _cpuid4_info) * num_cache_leaves);
 
 	oldmask = current->cpus_allowed;
 	retval = set_cpus_allowed(current, cpumask_of_cpu(cpu));
@@ -658,17 +656,14 @@ static int __cpuinit cpuid4_cache_sysfs_
 		return -ENOENT;
 
 	/* Allocate all required memory */
-	cache_kobject[cpu] = kmalloc(sizeof(struct kobject), GFP_KERNEL);
+	cache_kobject[cpu] = kzalloc(sizeof(struct kobject), GFP_KERNEL);
 	if (unlikely(cache_kobject[cpu] == NULL))
 		goto err_out;
-	memset(cache_kobject[cpu], 0, sizeof(struct kobject));
 
-	index_kobject[cpu] = kmalloc(
+	index_kobject[cpu] = kzalloc(
 	    sizeof(struct _index_kobject ) * num_cache_leaves, GFP_KERNEL);
 	if (unlikely(index_kobject[cpu] == NULL))
 		goto err_out;
-	memset(index_kobject[cpu], 0,
-	    sizeof(struct _index_kobject) * num_cache_leaves);
 
 	return 0;
 
diff -rubp linux-2.6.19-rc5_orig/arch/i386/kernel/cpu/mtrr/if.c linux-2.6.19-rc5_kzalloc/arch/i386/kernel/cpu/mtrr/if.c
--- linux-2.6.19-rc5_orig/arch/i386/kernel/cpu/mtrr/if.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/i386/kernel/cpu/mtrr/if.c	2006-11-11 22:44:04.000000000 +0200
@@ -44,10 +44,9 @@ mtrr_file_add(unsigned long base, unsign
 
 	max = num_var_ranges;
 	if (fcount == NULL) {
-		fcount = kmalloc(max * sizeof *fcount, GFP_KERNEL);
+		fcount = kzalloc(max * sizeof *fcount, GFP_KERNEL);
 		if (!fcount)
 			return -ENOMEM;
-		memset(fcount, 0, max * sizeof *fcount);
 		FILE_FCOUNT(file) = fcount;
 	}
 	if (!page) {
diff -rubp linux-2.6.19-rc5_orig/arch/i386/kernel/cpu/mtrr/main.c linux-2.6.19-rc5_kzalloc/arch/i386/kernel/cpu/mtrr/main.c
--- linux-2.6.19-rc5_orig/arch/i386/kernel/cpu/mtrr/main.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/i386/kernel/cpu/mtrr/main.c	2006-11-11 22:44:04.000000000 +0200
@@ -565,10 +565,8 @@ static int mtrr_save(struct sys_device *
 	int i;
 	int size = num_var_ranges * sizeof(struct mtrr_value);
 
-	mtrr_state = kmalloc(size,GFP_ATOMIC);
-	if (mtrr_state)
-		memset(mtrr_state,0,size);
-	else
+	mtrr_state = kzalloc(size,GFP_ATOMIC);
+	if (!mtrr_state)
 		return -ENOMEM;
 
 	for (i = 0; i < num_var_ranges; i++) {
diff -rubp linux-2.6.19-rc5_orig/arch/i386/kernel/io_apic.c linux-2.6.19-rc5_kzalloc/arch/i386/kernel/io_apic.c
--- linux-2.6.19-rc5_orig/arch/i386/kernel/io_apic.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/i386/kernel/io_apic.c	2006-11-11 22:44:04.000000000 +0200
@@ -704,14 +704,12 @@ static int __init balanced_irq_init(void
 		physical_balance = 1;
 
 	for_each_online_cpu(i) {
-		irq_cpu_data[i].irq_delta = kmalloc(sizeof(unsigned long) * NR_IRQS, GFP_KERNEL);
-		irq_cpu_data[i].last_irq = kmalloc(sizeof(unsigned long) * NR_IRQS, GFP_KERNEL);
+		irq_cpu_data[i].irq_delta = kzalloc(sizeof(unsigned long) * NR_IRQS, GFP_KERNEL);
+		irq_cpu_data[i].last_irq = kzalloc(sizeof(unsigned long) * NR_IRQS, GFP_KERNEL);
 		if (irq_cpu_data[i].irq_delta == NULL || irq_cpu_data[i].last_irq == NULL) {
 			printk(KERN_ERR "balanced_irq_init: out of memory");
 			goto failed;
 		}
-		memset(irq_cpu_data[i].irq_delta,0,sizeof(unsigned long) * NR_IRQS);
-		memset(irq_cpu_data[i].last_irq,0,sizeof(unsigned long) * NR_IRQS);
 	}
 	
 	printk(KERN_INFO "Starting balanced_irq\n");
@@ -2448,12 +2446,11 @@ static int __init ioapic_init_sysfs(void
 	for (i = 0; i < nr_ioapics; i++ ) {
 		size = sizeof(struct sys_device) + nr_ioapic_registers[i] 
 			* sizeof(struct IO_APIC_route_entry);
-		mp_ioapic_data[i] = kmalloc(size, GFP_KERNEL);
+		mp_ioapic_data[i] = kzalloc(size, GFP_KERNEL);
 		if (!mp_ioapic_data[i]) {
 			printk(KERN_ERR "Can't suspend/resume IOAPIC %d\n", i);
 			continue;
 		}
-		memset(mp_ioapic_data[i], 0, size);
 		dev = &mp_ioapic_data[i]->dev;
 		dev->id = i; 
 		dev->cls = &ioapic_sysdev_class;
diff -rubp linux-2.6.19-rc5_orig/arch/i386/kernel/mca.c linux-2.6.19-rc5_kzalloc/arch/i386/kernel/mca.c
--- linux-2.6.19-rc5_orig/arch/i386/kernel/mca.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/i386/kernel/mca.c	2006-11-11 22:44:04.000000000 +0200
@@ -283,10 +283,9 @@ static int __init mca_init(void)
 	bus->f.mca_transform_memory = mca_dummy_transform_memory;
 
 	/* get the motherboard device */
-	mca_dev = kmalloc(sizeof(struct mca_device), GFP_KERNEL);
+	mca_dev = kzalloc(sizeof(struct mca_device), GFP_KERNEL);
 	if(unlikely(!mca_dev))
 		goto out_nomem;
-	memset(mca_dev, 0, sizeof(struct mca_device));
 
 	/*
 	 * We do not expect many MCA interrupts during initialization,
@@ -310,11 +309,9 @@ static int __init mca_init(void)
 	mca_dev->slot = MCA_MOTHERBOARD;
 	mca_register_device(MCA_PRIMARY_BUS, mca_dev);
 
-	mca_dev = kmalloc(sizeof(struct mca_device), GFP_ATOMIC);
+	mca_dev = kzalloc(sizeof(struct mca_device), GFP_ATOMIC);
 	if(unlikely(!mca_dev))
 		goto out_unlock_nomem;
-	memset(mca_dev, 0, sizeof(struct mca_device));
-
 
 	/* Put motherboard into video setup mode, read integrated video
 	 * POS registers, and turn motherboard setup off.
@@ -349,10 +346,9 @@ static int __init mca_init(void)
 	}
 	if(which_scsi) {
 		/* found a scsi card */
-		mca_dev = kmalloc(sizeof(struct mca_device), GFP_ATOMIC);
+		mca_dev = kzalloc(sizeof(struct mca_device), GFP_ATOMIC);
 		if(unlikely(!mca_dev))
 			goto out_unlock_nomem;
-		memset(mca_dev, 0, sizeof(struct mca_device));
 
 		for(j = 0; j < 8; j++)
 			mca_dev->pos[j] = pos[j];
@@ -378,10 +374,9 @@ static int __init mca_init(void)
 		if(!mca_read_and_store_pos(pos))
 			continue;
 
-		mca_dev = kmalloc(sizeof(struct mca_device), GFP_ATOMIC);
+		mca_dev = kzalloc(sizeof(struct mca_device), GFP_ATOMIC);
 		if(unlikely(!mca_dev))
 			goto out_unlock_nomem;
-		memset(mca_dev, 0, sizeof(struct mca_device));
 
 		for(j=0; j<8; j++)
 			mca_dev->pos[j]=pos[j];
diff -rubp linux-2.6.19-rc5_orig/arch/i386/kernel/pci-dma.c linux-2.6.19-rc5_kzalloc/arch/i386/kernel/pci-dma.c
--- linux-2.6.19-rc5_orig/arch/i386/kernel/pci-dma.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/i386/kernel/pci-dma.c	2006-11-11 22:44:04.000000000 +0200
@@ -92,14 +92,12 @@ int dma_declare_coherent_memory(struct d
 	if (!mem_base)
 		goto out;
 
-	dev->dma_mem = kmalloc(sizeof(struct dma_coherent_mem), GFP_KERNEL);
+	dev->dma_mem = kzalloc(sizeof(struct dma_coherent_mem), GFP_KERNEL);
 	if (!dev->dma_mem)
 		goto out;
-	memset(dev->dma_mem, 0, sizeof(struct dma_coherent_mem));
-	dev->dma_mem->bitmap = kmalloc(bitmap_size, GFP_KERNEL);
+	dev->dma_mem->bitmap = kzalloc(bitmap_size, GFP_KERNEL);
 	if (!dev->dma_mem->bitmap)
 		goto free1_out;
-	memset(dev->dma_mem->bitmap, 0, bitmap_size);
 
 	dev->dma_mem->virt_base = mem_base;
 	dev->dma_mem->device_base = device_addr;
diff -rubp linux-2.6.19-rc5_orig/arch/i386/mach-voyager/voyager_cat.c linux-2.6.19-rc5_kzalloc/arch/i386/mach-voyager/voyager_cat.c
--- linux-2.6.19-rc5_orig/arch/i386/mach-voyager/voyager_cat.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/i386/mach-voyager/voyager_cat.c	2006-11-11 22:44:18.000000000 +0200
@@ -776,7 +776,7 @@ voyager_cat_init(void)
 		for(asic=0; asic < (*modpp)->num_asics; asic++) {
 			int j;
 			voyager_asic_t *asicp = *asicpp 
-				= kmalloc(sizeof(voyager_asic_t), GFP_KERNEL); /*&voyager_asic_storage[asic_count++];*/
+				= kzalloc(sizeof(voyager_asic_t), GFP_KERNEL); /*&voyager_asic_storage[asic_count++];*/
 			voyager_sp_table_t *sp_table;
 			voyager_at_t *asic_table;
 			voyager_jtt_t *jtag_table;
@@ -785,7 +785,6 @@ voyager_cat_init(void)
 				printk("**WARNING** kmalloc failure in cat_init\n");
 				continue;
 			}
-			memset(asicp, 0, sizeof(voyager_asic_t));
 			asicpp = &(asicp->next);
 			asicp->asic_location = asic;
 			sp_table = (voyager_sp_table_t *)(eprom_buf + sp_offset);
@@ -851,8 +850,7 @@ voyager_cat_init(void)
 #endif
 
 		{
-			struct resource *res = kmalloc(sizeof(struct resource),GFP_KERNEL);
-			memset(res, 0, sizeof(struct resource));
+			struct resource *res = kzalloc(sizeof(struct resource),GFP_KERNEL);
 			res->name = kmalloc(128, GFP_KERNEL);
 			sprintf((char *)res->name, "Voyager %s Quad CPI", cat_module_name(i));
 			res->start = qic_addr;
diff -rubp linux-2.6.19-rc5_orig/arch/ia64/hp/common/sba_iommu.c linux-2.6.19-rc5_kzalloc/arch/ia64/hp/common/sba_iommu.c
--- linux-2.6.19-rc5_orig/arch/ia64/hp/common/sba_iommu.c	2006-11-09 12:16:22.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/ia64/hp/common/sba_iommu.c	2006-11-11 22:44:04.000000000 +0200
@@ -1672,15 +1672,13 @@ ioc_sac_init(struct ioc *ioc)
 	 * SAC (single address cycle) addressable, so allocate a
 	 * pseudo-device to enforce that.
 	 */
-	sac = kmalloc(sizeof(*sac), GFP_KERNEL);
+	sac = kzalloc(sizeof(*sac), GFP_KERNEL);
 	if (!sac)
 		panic(PFX "Couldn't allocate struct pci_dev");
-	memset(sac, 0, sizeof(*sac));
 
-	controller = kmalloc(sizeof(*controller), GFP_KERNEL);
+	controller = kzalloc(sizeof(*controller), GFP_KERNEL);
 	if (!controller)
 		panic(PFX "Couldn't allocate struct pci_controller");
-	memset(controller, 0, sizeof(*controller));
 
 	controller->iommu = ioc;
 	sac->sysdata = controller;
@@ -1737,12 +1735,10 @@ ioc_init(u64 hpa, void *handle)
 	struct ioc *ioc;
 	struct ioc_iommu *info;
 
-	ioc = kmalloc(sizeof(*ioc), GFP_KERNEL);
+	ioc = kzalloc(sizeof(*ioc), GFP_KERNEL);
 	if (!ioc)
 		return NULL;
 
-	memset(ioc, 0, sizeof(*ioc));
-
 	ioc->next = ioc_list;
 	ioc_list = ioc;
 
diff -rubp linux-2.6.19-rc5_orig/arch/ia64/hp/sim/simserial.c linux-2.6.19-rc5_kzalloc/arch/ia64/hp/sim/simserial.c
--- linux-2.6.19-rc5_orig/arch/ia64/hp/sim/simserial.c	2006-11-09 12:16:22.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/ia64/hp/sim/simserial.c	2006-11-11 22:44:04.000000000 +0200
@@ -684,12 +684,11 @@ static int get_async_struct(int line, st
 		*ret_info = sstate->info;
 		return 0;
 	}
-	info = kmalloc(sizeof(struct async_struct), GFP_KERNEL);
+	info = kzalloc(sizeof(struct async_struct), GFP_KERNEL);
 	if (!info) {
 		sstate->count--;
 		return -ENOMEM;
 	}
-	memset(info, 0, sizeof(struct async_struct));
 	init_waitqueue_head(&info->open_wait);
 	init_waitqueue_head(&info->close_wait);
 	init_waitqueue_head(&info->delta_msr_wait);
diff -rubp linux-2.6.19-rc5_orig/arch/ia64/kernel/perfmon.c linux-2.6.19-rc5_kzalloc/arch/ia64/kernel/perfmon.c
--- linux-2.6.19-rc5_orig/arch/ia64/kernel/perfmon.c	2006-11-09 12:16:22.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/ia64/kernel/perfmon.c	2006-11-11 22:44:04.000000000 +0200
@@ -853,9 +853,8 @@ pfm_context_alloc(void)
 	 * allocate context descriptor 
 	 * must be able to free with interrupts disabled
 	 */
-	ctx = kmalloc(sizeof(pfm_context_t), GFP_KERNEL);
+	ctx = kzalloc(sizeof(pfm_context_t), GFP_KERNEL);
 	if (ctx) {
-		memset(ctx, 0, sizeof(pfm_context_t));
 		DPRINT(("alloc ctx @%p\n", ctx));
 	}
 	return ctx;
diff -rubp linux-2.6.19-rc5_orig/arch/ia64/pci/pci.c linux-2.6.19-rc5_kzalloc/arch/ia64/pci/pci.c
--- linux-2.6.19-rc5_orig/arch/ia64/pci/pci.c	2006-11-09 12:16:22.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/ia64/pci/pci.c	2006-11-11 22:44:04.000000000 +0200
@@ -125,11 +125,10 @@ alloc_pci_controller (int seg)
 {
 	struct pci_controller *controller;
 
-	controller = kmalloc(sizeof(*controller), GFP_KERNEL);
+	controller = kzalloc(sizeof(*controller), GFP_KERNEL);
 	if (!controller)
 		return NULL;
 
-	memset(controller, 0, sizeof(*controller));
 	controller->segment = seg;
 	controller->node = -1;
 	return controller;
diff -rubp linux-2.6.19-rc5_orig/arch/m68k/amiga/chipram.c linux-2.6.19-rc5_kzalloc/arch/m68k/amiga/chipram.c
--- linux-2.6.19-rc5_orig/arch/m68k/amiga/chipram.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/m68k/amiga/chipram.c	2006-11-11 22:44:04.000000000 +0200
@@ -52,10 +52,9 @@ void *amiga_chip_alloc(unsigned long siz
 #ifdef DEBUG
     printk("amiga_chip_alloc: allocate %ld bytes\n", size);
 #endif
-    res = kmalloc(sizeof(struct resource), GFP_KERNEL);
+    res = kzalloc(sizeof(struct resource), GFP_KERNEL);
     if (!res)
 	return NULL;
-    memset(res, 0, sizeof(struct resource));
     res->name = name;
 
     if (allocate_resource(&chipram_res, res, size, 0, UINT_MAX, PAGE_SIZE, NULL, NULL) < 0) {
diff -rubp linux-2.6.19-rc5_orig/arch/m68k/atari/hades-pci.c linux-2.6.19-rc5_kzalloc/arch/m68k/atari/hades-pci.c
--- linux-2.6.19-rc5_orig/arch/m68k/atari/hades-pci.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/m68k/atari/hades-pci.c	2006-11-11 22:44:04.000000000 +0200
@@ -375,10 +375,9 @@ struct pci_bus_info * __init init_hades_
 	 * Allocate memory for bus info structure.
 	 */
 
-	bus = kmalloc(sizeof(struct pci_bus_info), GFP_KERNEL);
+	bus = kzalloc(sizeof(struct pci_bus_info), GFP_KERNEL);
 	if (!bus)
 		return NULL;
-	memset(bus, 0, sizeof(struct pci_bus_info));
 
 	/*
 	 * Claim resources. The m68k has no separate I/O space, both
diff -rubp linux-2.6.19-rc5_orig/arch/powerpc/kernel/ibmebus.c linux-2.6.19-rc5_kzalloc/arch/powerpc/kernel/ibmebus.c
--- linux-2.6.19-rc5_orig/arch/powerpc/kernel/ibmebus.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/powerpc/kernel/ibmebus.c	2006-11-11 22:44:04.000000000 +0200
@@ -210,11 +210,10 @@ static struct ibmebus_dev* __devinit ibm
 		return NULL;
 	}
 
-	dev = kmalloc(sizeof(struct ibmebus_dev), GFP_KERNEL);
+	dev = kzalloc(sizeof(struct ibmebus_dev), GFP_KERNEL);
 	if (!dev) {
 		return NULL;
 	}
-	memset(dev, 0, sizeof(struct ibmebus_dev));
 
 	dev->ofdev.node = of_node_get(dn);
        
diff -rubp linux-2.6.19-rc5_orig/arch/powerpc/kernel/of_device.c linux-2.6.19-rc5_kzalloc/arch/powerpc/kernel/of_device.c
--- linux-2.6.19-rc5_orig/arch/powerpc/kernel/of_device.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/powerpc/kernel/of_device.c	2006-11-11 22:44:04.000000000 +0200
@@ -214,10 +214,9 @@ struct of_device* of_platform_device_cre
 {
 	struct of_device *dev;
 
-	dev = kmalloc(sizeof(*dev), GFP_KERNEL);
+	dev = kzalloc(sizeof(*dev), GFP_KERNEL);
 	if (!dev)
 		return NULL;
-	memset(dev, 0, sizeof(*dev));
 
 	dev->node = of_node_get(np);
 	dev->dma_mask = 0xffffffffUL;
diff -rubp linux-2.6.19-rc5_orig/arch/powerpc/kernel/pci_64.c linux-2.6.19-rc5_kzalloc/arch/powerpc/kernel/pci_64.c
--- linux-2.6.19-rc5_orig/arch/powerpc/kernel/pci_64.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/powerpc/kernel/pci_64.c	2006-11-11 22:44:18.000000000 +0200
@@ -329,7 +329,7 @@ struct pci_dev *of_create_pci_dev(struct
 	struct pci_dev *dev;
 	const char *type;
 
-	dev = kmalloc(sizeof(struct pci_dev), GFP_KERNEL);
+	dev = kzalloc(sizeof(struct pci_dev), GFP_KERNEL);
 	if (!dev)
 		return NULL;
 	type = get_property(node, "device_type", NULL);
@@ -338,7 +338,6 @@ struct pci_dev *of_create_pci_dev(struct
 
 	DBG("    create device, devfn: %x, type: %s\n", devfn, type);
 
-	memset(dev, 0, sizeof(struct pci_dev));
 	dev->bus = bus;
 	dev->sysdata = node;
 	dev->dev.parent = bus->bridge;
diff -rubp linux-2.6.19-rc5_orig/arch/powerpc/kernel/rtas_flash.c linux-2.6.19-rc5_kzalloc/arch/powerpc/kernel/rtas_flash.c
--- linux-2.6.19-rc5_orig/arch/powerpc/kernel/rtas_flash.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/powerpc/kernel/rtas_flash.c	2006-11-11 22:44:04.000000000 +0200
@@ -668,14 +668,12 @@ static int initialize_flash_pde_data(con
 	int *status;
 	int token;
 
-	dp->data = kmalloc(buf_size, GFP_KERNEL);
+	dp->data = kzalloc(buf_size, GFP_KERNEL);
 	if (dp->data == NULL) {
 		remove_flash_pde(dp);
 		return -ENOMEM;
 	}
 
-	memset(dp->data, 0, buf_size);
-
 	/*
 	 * This code assumes that the status int is the first member of the
 	 * struct 
diff -rubp linux-2.6.19-rc5_orig/arch/powerpc/kernel/smp-tbsync.c linux-2.6.19-rc5_kzalloc/arch/powerpc/kernel/smp-tbsync.c
--- linux-2.6.19-rc5_orig/arch/powerpc/kernel/smp-tbsync.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/powerpc/kernel/smp-tbsync.c	2006-11-11 22:44:04.000000000 +0200
@@ -116,8 +116,7 @@ void __devinit smp_generic_give_timebase
 	printk("Synchronizing timebase\n");
 
 	/* if this fails then this kernel won't work anyway... */
-	tbsync = kmalloc( sizeof(*tbsync), GFP_KERNEL );
-	memset( tbsync, 0, sizeof(*tbsync) );
+	tbsync = kzalloc( sizeof(*tbsync), GFP_KERNEL );
 	mb();
 	running = 1;
 
diff -rubp linux-2.6.19-rc5_orig/arch/powerpc/platforms/iseries/iommu.c linux-2.6.19-rc5_kzalloc/arch/powerpc/platforms/iseries/iommu.c
--- linux-2.6.19-rc5_orig/arch/powerpc/platforms/iseries/iommu.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/powerpc/platforms/iseries/iommu.c	2006-11-11 22:44:04.000000000 +0200
@@ -114,12 +114,10 @@ void iommu_table_getparms_iSeries(unsign
 {
 	struct iommu_table_cb *parms;
 
-	parms = kmalloc(sizeof(*parms), GFP_KERNEL);
+	parms = kzalloc(sizeof(*parms), GFP_KERNEL);
 	if (parms == NULL)
 		panic("PCI_DMA: TCE Table Allocation failed.");
 
-	memset(parms, 0, sizeof(*parms));
-
 	parms->itc_busno = busno;
 	parms->itc_slotno = slotno;
 	parms->itc_virtbus = virtbus;
diff -rubp linux-2.6.19-rc5_orig/arch/powerpc/platforms/iseries/viopath.c linux-2.6.19-rc5_kzalloc/arch/powerpc/platforms/iseries/viopath.c
--- linux-2.6.19-rc5_orig/arch/powerpc/platforms/iseries/viopath.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/powerpc/platforms/iseries/viopath.c	2006-11-11 22:44:04.000000000 +0200
@@ -119,10 +119,9 @@ static int proc_viopath_show(struct seq_
 	struct device_node *node;
 	const char *sysid;
 
-	buf = kmalloc(HW_PAGE_SIZE, GFP_KERNEL);
+	buf = kzalloc(HW_PAGE_SIZE, GFP_KERNEL);
 	if (!buf)
 		return 0;
-	memset(buf, 0, HW_PAGE_SIZE);
 
 	handle = dma_map_single(iSeries_vio_dev, buf, HW_PAGE_SIZE,
 				DMA_FROM_DEVICE);
diff -rubp linux-2.6.19-rc5_orig/arch/powerpc/platforms/pseries/reconfig.c linux-2.6.19-rc5_kzalloc/arch/powerpc/platforms/pseries/reconfig.c
--- linux-2.6.19-rc5_orig/arch/powerpc/platforms/pseries/reconfig.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/powerpc/platforms/pseries/reconfig.c	2006-11-11 22:44:04.000000000 +0200
@@ -268,11 +268,10 @@ static char * parse_next_property(char *
 static struct property *new_property(const char *name, const int length,
 				     const unsigned char *value, struct property *last)
 {
-	struct property *new = kmalloc(sizeof(*new), GFP_KERNEL);
+	struct property *new = kzalloc(sizeof(*new), GFP_KERNEL);
 
 	if (!new)
 		return NULL;
-	memset(new, 0, sizeof(*new));
 
 	if (!(new->name = kmalloc(strlen(name) + 1, GFP_KERNEL)))
 		goto cleanup;
diff -rubp linux-2.6.19-rc5_orig/arch/powerpc/sysdev/qe_lib/ucc_fast.c linux-2.6.19-rc5_kzalloc/arch/powerpc/sysdev/qe_lib/ucc_fast.c
--- linux-2.6.19-rc5_orig/arch/powerpc/sysdev/qe_lib/ucc_fast.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/powerpc/sysdev/qe_lib/ucc_fast.c	2006-11-11 22:44:04.000000000 +0200
@@ -217,13 +217,12 @@ int ucc_fast_init(struct ucc_fast_info *
 	}
 
 	uccf = (struct ucc_fast_private *)
-		 kmalloc(sizeof(struct ucc_fast_private), GFP_KERNEL);
+		 kzalloc(sizeof(struct ucc_fast_private), GFP_KERNEL);
 	if (!uccf) {
 		uccf_err
 		    ("ucc_fast_init: No memory for UCC slow data structure!");
 		return -ENOMEM;
 	}
-	memset(uccf, 0, sizeof(struct ucc_fast_private));
 
 	/* Fill fast UCC structure */
 	uccf->uf_info = uf_info;
diff -rubp linux-2.6.19-rc5_orig/arch/powerpc/sysdev/qe_lib/ucc_slow.c linux-2.6.19-rc5_kzalloc/arch/powerpc/sysdev/qe_lib/ucc_slow.c
--- linux-2.6.19-rc5_orig/arch/powerpc/sysdev/qe_lib/ucc_slow.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/powerpc/sysdev/qe_lib/ucc_slow.c	2006-11-11 22:44:04.000000000 +0200
@@ -169,13 +169,12 @@ int ucc_slow_init(struct ucc_slow_info *
 	}
 
 	uccs = (struct ucc_slow_private *)
-		kmalloc(sizeof(struct ucc_slow_private), GFP_KERNEL);
+		kzalloc(sizeof(struct ucc_slow_private), GFP_KERNEL);
 	if (!uccs) {
 		uccs_err
 		    ("ucc_slow_init: No memory for UCC slow data structure!");
 		return -ENOMEM;
 	}
-	memset(uccs, 0, sizeof(struct ucc_slow_private));
 
 	/* Fill slow UCC structure */
 	uccs->us_info = us_info;
diff -rubp linux-2.6.19-rc5_orig/arch/sh/drivers/dma/dma-api.c linux-2.6.19-rc5_kzalloc/arch/sh/drivers/dma/dma-api.c
--- linux-2.6.19-rc5_orig/arch/sh/drivers/dma/dma-api.c	2006-11-09 12:16:22.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/sh/drivers/dma/dma-api.c	2006-11-11 22:44:04.000000000 +0200
@@ -242,11 +242,9 @@ int register_dmac(struct dma_info *info)
 
 		size = sizeof(struct dma_channel) * info->nr_channels;
 
-		info->channels = kmalloc(size, GFP_KERNEL);
+		info->channels = kzalloc(size, GFP_KERNEL);
 		if (!info->channels)
 			return -ENOMEM;
-
-		memset(info->channels, 0, size);
 	}
 
 	total_channels = get_nr_channels();
diff -rubp linux-2.6.19-rc5_orig/arch/sparc/kernel/ioport.c linux-2.6.19-rc5_kzalloc/arch/sparc/kernel/ioport.c
--- linux-2.6.19-rc5_orig/arch/sparc/kernel/ioport.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/sparc/kernel/ioport.c	2006-11-11 22:44:04.000000000 +0200
@@ -317,9 +317,8 @@ void *sbus_alloc_consistent(struct sbus_
 	if ((va = __get_free_pages(GFP_KERNEL|__GFP_COMP, order)) == 0)
 		goto err_nopages;
 
-	if ((res = kmalloc(sizeof(struct resource), GFP_KERNEL)) == NULL)
+	if ((res = kzalloc(sizeof(struct resource), GFP_KERNEL)) == NULL)
 		goto err_nomem;
-	memset((char*)res, 0, sizeof(struct resource));
 
 	if (allocate_resource(&_sparc_dvma, res, len_total,
 	    _sparc_dvma.start, _sparc_dvma.end, PAGE_SIZE, NULL, NULL) != 0) {
@@ -589,12 +588,11 @@ void *pci_alloc_consistent(struct pci_de
 		return NULL;
 	}
 
-	if ((res = kmalloc(sizeof(struct resource), GFP_KERNEL)) == NULL) {
+	if ((res = kzalloc(sizeof(struct resource), GFP_KERNEL)) == NULL) {
 		free_pages(va, order);
 		printk("pci_alloc_consistent: no core\n");
 		return NULL;
 	}
-	memset((char*)res, 0, sizeof(struct resource));
 
 	if (allocate_resource(&_sparc_dvma, res, len_total,
 	    _sparc_dvma.start, _sparc_dvma.end, PAGE_SIZE, NULL, NULL) != 0) {
diff -rubp linux-2.6.19-rc5_orig/arch/sparc/kernel/of_device.c linux-2.6.19-rc5_kzalloc/arch/sparc/kernel/of_device.c
--- linux-2.6.19-rc5_orig/arch/sparc/kernel/of_device.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/sparc/kernel/of_device.c	2006-11-11 22:44:04.000000000 +0200
@@ -793,10 +793,9 @@ struct of_device* of_platform_device_cre
 {
 	struct of_device *dev;
 
-	dev = kmalloc(sizeof(*dev), GFP_KERNEL);
+	dev = kzalloc(sizeof(*dev), GFP_KERNEL);
 	if (!dev)
 		return NULL;
-	memset(dev, 0, sizeof(*dev));
 
 	dev->dev.parent = parent;
 	dev->dev.bus = bus;
diff -rubp linux-2.6.19-rc5_orig/arch/sparc/kernel/sun4d_irq.c linux-2.6.19-rc5_kzalloc/arch/sparc/kernel/sun4d_irq.c
--- linux-2.6.19-rc5_orig/arch/sparc/kernel/sun4d_irq.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/sparc/kernel/sun4d_irq.c	2006-11-11 22:44:04.000000000 +0200
@@ -545,8 +545,7 @@ void __init sun4d_init_sbi_irq(void)
 	nsbi = 0;
 	for_each_sbus(sbus)
 		nsbi++;
-	sbus_actions = (struct sbus_action *)kmalloc (nsbi * 8 * 4 * sizeof(struct sbus_action), GFP_ATOMIC);
-	memset (sbus_actions, 0, (nsbi * 8 * 4 * sizeof(struct sbus_action)));
+	sbus_actions = (struct sbus_action *)kzalloc (nsbi * 8 * 4 * sizeof(struct sbus_action), GFP_ATOMIC);
 	for_each_sbus(sbus) {
 #ifdef CONFIG_SMP	
 		extern unsigned char boot_cpu_id;
diff -rubp linux-2.6.19-rc5_orig/arch/sparc/mm/io-unit.c linux-2.6.19-rc5_kzalloc/arch/sparc/mm/io-unit.c
--- linux-2.6.19-rc5_orig/arch/sparc/mm/io-unit.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/sparc/mm/io-unit.c	2006-11-11 22:44:04.000000000 +0200
@@ -41,9 +41,8 @@ iounit_init(int sbi_node, int io_node, s
 	struct linux_prom_registers iommu_promregs[PROMREG_MAX];
 	struct resource r;
 
-	iounit = kmalloc(sizeof(struct iounit_struct), GFP_ATOMIC);
+	iounit = kzalloc(sizeof(struct iounit_struct), GFP_ATOMIC);
 
-	memset(iounit, 0, sizeof(*iounit));
 	iounit->limit[0] = IOUNIT_BMAP1_START;
 	iounit->limit[1] = IOUNIT_BMAP2_START;
 	iounit->limit[2] = IOUNIT_BMAPM_START;
diff -rubp linux-2.6.19-rc5_orig/arch/sparc64/kernel/chmc.c linux-2.6.19-rc5_kzalloc/arch/sparc64/kernel/chmc.c
--- linux-2.6.19-rc5_orig/arch/sparc64/kernel/chmc.c	2006-11-09 12:16:22.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/sparc64/kernel/chmc.c	2006-11-11 22:44:04.000000000 +0200
@@ -341,7 +341,7 @@ static void fetch_decode_regs(struct mct
 
 static int init_one_mctrl(struct device_node *dp)
 {
-	struct mctrl_info *mp = kmalloc(sizeof(*mp), GFP_KERNEL);
+	struct mctrl_info *mp = kzalloc(sizeof(*mp), GFP_KERNEL);
 	int portid = of_getintprop_default(dp, "portid", -1);
 	struct linux_prom64_registers *regs;
 	void *pval;
@@ -349,7 +349,6 @@ static int init_one_mctrl(struct device_
 
 	if (!mp)
 		return -1;
-	memset(mp, 0, sizeof(*mp));
 	if (portid == -1)
 		goto fail;
 
diff -rubp linux-2.6.19-rc5_orig/arch/sparc64/kernel/isa.c linux-2.6.19-rc5_kzalloc/arch/sparc64/kernel/isa.c
--- linux-2.6.19-rc5_orig/arch/sparc64/kernel/isa.c	2006-11-09 12:16:22.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/sparc64/kernel/isa.c	2006-11-11 22:44:04.000000000 +0200
@@ -72,14 +72,12 @@ static void __init isa_fill_children(str
 		struct linux_prom_registers *regs;
 		struct sparc_isa_device *isa_dev;
 
-		isa_dev = kmalloc(sizeof(*isa_dev), GFP_KERNEL);
+		isa_dev = kzalloc(sizeof(*isa_dev), GFP_KERNEL);
 		if (!isa_dev) {
 			fatal_err("cannot allocate child isa_dev");
 			prom_halt();
 		}
 
-		memset(isa_dev, 0, sizeof(*isa_dev));
-
 		/* Link it in to parent. */
 		isa_dev->next = parent_isa_dev->child;
 		parent_isa_dev->child = isa_dev;
@@ -104,14 +102,12 @@ static void __init isa_fill_devices(stru
 		struct linux_prom_registers *regs;
 		struct sparc_isa_device *isa_dev;
 
-		isa_dev = kmalloc(sizeof(*isa_dev), GFP_KERNEL);
+		isa_dev = kzalloc(sizeof(*isa_dev), GFP_KERNEL);
 		if (!isa_dev) {
 			printk(KERN_DEBUG "ISA: cannot allocate isa_dev");
 			return;
 		}
 
-		memset(isa_dev, 0, sizeof(*isa_dev));
-
 		isa_dev->ofdev.node = dp;
 		isa_dev->ofdev.dev.parent = &isa_br->ofdev.dev;
 		isa_dev->ofdev.dev.bus = &isa_bus_type;
@@ -180,14 +176,12 @@ void __init isa_init(void)
 		pbm = pdev_cookie->pbm;
 		dp = pdev_cookie->prom_node;
 
-		isa_br = kmalloc(sizeof(*isa_br), GFP_KERNEL);
+		isa_br = kzalloc(sizeof(*isa_br), GFP_KERNEL);
 		if (!isa_br) {
 			printk(KERN_DEBUG "isa: cannot allocate sparc_isa_bridge");
 			return;
 		}
 
-		memset(isa_br, 0, sizeof(*isa_br));
-
 		isa_br->ofdev.node = dp;
 		isa_br->ofdev.dev.parent = &pdev->dev;
 		isa_br->ofdev.dev.bus = &isa_bus_type;
diff -rubp linux-2.6.19-rc5_orig/arch/sparc64/kernel/of_device.c linux-2.6.19-rc5_kzalloc/arch/sparc64/kernel/of_device.c
--- linux-2.6.19-rc5_orig/arch/sparc64/kernel/of_device.c	2006-11-09 12:16:22.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/sparc64/kernel/of_device.c	2006-11-11 22:44:04.000000000 +0200
@@ -1007,10 +1007,9 @@ struct of_device* of_platform_device_cre
 {
 	struct of_device *dev;
 
-	dev = kmalloc(sizeof(*dev), GFP_KERNEL);
+	dev = kzalloc(sizeof(*dev), GFP_KERNEL);
 	if (!dev)
 		return NULL;
-	memset(dev, 0, sizeof(*dev));
 
 	dev->dev.parent = parent;
 	dev->dev.bus = bus;
diff -rubp linux-2.6.19-rc5_orig/arch/sparc64/kernel/pci_sun4v.c linux-2.6.19-rc5_kzalloc/arch/sparc64/kernel/pci_sun4v.c
--- linux-2.6.19-rc5_orig/arch/sparc64/kernel/pci_sun4v.c	2006-11-09 12:16:22.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/sparc64/kernel/pci_sun4v.c	2006-11-11 22:44:04.000000000 +0200
@@ -798,7 +798,7 @@ static struct pci_ops pci_sun4v_ops = {
 static void pbm_scan_bus(struct pci_controller_info *p,
 			 struct pci_pbm_info *pbm)
 {
-	struct pcidev_cookie *cookie = kmalloc(sizeof(*cookie), GFP_KERNEL);
+	struct pcidev_cookie *cookie = kzalloc(sizeof(*cookie), GFP_KERNEL);
 
 	if (!cookie) {
 		prom_printf("%s: Critical allocation failure.\n", pbm->name);
@@ -806,7 +806,6 @@ static void pbm_scan_bus(struct pci_cont
 	}
 
 	/* All we care about is the PBM. */
-	memset(cookie, 0, sizeof(*cookie));
 	cookie->pbm = pbm;
 
 	pbm->pci_bus = pci_scan_bus(pbm->pci_first_busno, p->pci_ops, pbm);
@@ -1048,12 +1047,11 @@ static void pci_sun4v_iommu_init(struct 
 	/* Allocate and initialize the free area map.  */
 	sz = num_tsb_entries / 8;
 	sz = (sz + 7UL) & ~7UL;
-	iommu->arena.map = kmalloc(sz, GFP_KERNEL);
+	iommu->arena.map = kzalloc(sz, GFP_KERNEL);
 	if (!iommu->arena.map) {
 		prom_printf("PCI_IOMMU: Error, kmalloc(arena.map) failed.\n");
 		prom_halt();
 	}
-	memset(iommu->arena.map, 0, sz);
 	iommu->arena.limit = num_tsb_entries;
 
 	sz = probe_existing_entries(pbm, iommu);
@@ -1164,24 +1162,20 @@ void sun4v_pci_init(struct device_node *
 		per_cpu(pci_iommu_batch, i).pglist = (u64 *) page;
 	}
 
-	p = kmalloc(sizeof(struct pci_controller_info), GFP_ATOMIC);
+	p = kzalloc(sizeof(struct pci_controller_info), GFP_ATOMIC);
 	if (!p)
 		goto fatal_memory_error;
 
-	memset(p, 0, sizeof(*p));
-
-	iommu = kmalloc(sizeof(struct pci_iommu), GFP_ATOMIC);
+	iommu = kzalloc(sizeof(struct pci_iommu), GFP_ATOMIC);
 	if (!iommu)
 		goto fatal_memory_error;
 
-	memset(iommu, 0, sizeof(*iommu));
 	p->pbm_A.iommu = iommu;
 
-	iommu = kmalloc(sizeof(struct pci_iommu), GFP_ATOMIC);
+	iommu = kzalloc(sizeof(struct pci_iommu), GFP_ATOMIC);
 	if (!iommu)
 		goto fatal_memory_error;
 
-	memset(iommu, 0, sizeof(*iommu));
 	p->pbm_B.iommu = iommu;
 
 	p->next = pci_controller_root;
diff -rubp linux-2.6.19-rc5_orig/arch/um/drivers/net_kern.c linux-2.6.19-rc5_kzalloc/arch/um/drivers/net_kern.c
--- linux-2.6.19-rc5_orig/arch/um/drivers/net_kern.c	2006-11-09 12:16:22.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/um/drivers/net_kern.c	2006-11-11 22:44:04.000000000 +0200
@@ -333,13 +333,12 @@ static int eth_configure(int n, void *in
 	size = transport->private_size + sizeof(struct uml_net_private) + 
 		sizeof(((struct uml_net_private *) 0)->user);
 
-	device = kmalloc(sizeof(*device), GFP_KERNEL);
+	device = kzalloc(sizeof(*device), GFP_KERNEL);
 	if (device == NULL) {
 		printk(KERN_ERR "eth_configure failed to allocate uml_net\n");
 		return(1);
 	}
 
-	memset(device, 0, sizeof(*device));
 	INIT_LIST_HEAD(&device->list);
 	device->index = n;
 
diff -rubp linux-2.6.19-rc5_orig/arch/x86_64/kernel/io_apic.c linux-2.6.19-rc5_kzalloc/arch/x86_64/kernel/io_apic.c
--- linux-2.6.19-rc5_orig/arch/x86_64/kernel/io_apic.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/x86_64/kernel/io_apic.c	2006-11-11 22:44:04.000000000 +0200
@@ -1709,12 +1709,11 @@ static int __init ioapic_init_sysfs(void
 	for (i = 0; i < nr_ioapics; i++ ) {
 		size = sizeof(struct sys_device) + nr_ioapic_registers[i]
 			* sizeof(struct IO_APIC_route_entry);
-		mp_ioapic_data[i] = kmalloc(size, GFP_KERNEL);
+		mp_ioapic_data[i] = kzalloc(size, GFP_KERNEL);
 		if (!mp_ioapic_data[i]) {
 			printk(KERN_ERR "Can't suspend/resume IOAPIC %d\n", i);
 			continue;
 		}
-		memset(mp_ioapic_data[i], 0, size);
 		dev = &mp_ioapic_data[i]->dev;
 		dev->id = i;
 		dev->cls = &ioapic_sysdev_class;
