Replace kmalloc+memset with kzalloc Patch 3/17 Signed-off-by: Yan Burman diff -rubp linux-2.6.19-rc5_orig/drivers/net/b44.c linux-2.6.19-rc5_kzalloc/drivers/net/b44.c --- linux-2.6.19-rc5_orig/drivers/net/b44.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/b44.c 2006-11-11 22:44:04.000000000 +0200 @@ -1516,14 +1516,13 @@ static void b44_setup_pseudo_magicp(stru u8 *pwol_pattern; u8 pwol_mask[B44_PMASK_SIZE]; - pwol_pattern = kmalloc(B44_PATTERN_SIZE, GFP_KERNEL); + /* Ipv4 magic packet pattern - pattern 0.*/ + pwol_pattern = kzalloc(B44_PATTERN_SIZE, GFP_KERNEL); if (!pwol_pattern) { printk(KERN_ERR PFX "Memory not available for WOL\n"); return; } - /* Ipv4 magic packet pattern - pattern 0.*/ - memset(pwol_pattern, 0, B44_PATTERN_SIZE); memset(pwol_mask, 0, B44_PMASK_SIZE); plen0 = b44_magic_pattern(bp->dev->dev_addr, pwol_pattern, pwol_mask, B44_ETHIPV4UDP_HLEN); diff -rubp linux-2.6.19-rc5_orig/drivers/net/bonding/bond_main.c linux-2.6.19-rc5_kzalloc/drivers/net/bonding/bond_main.c --- linux-2.6.19-rc5_orig/drivers/net/bonding/bond_main.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/bonding/bond_main.c 2006-11-11 22:44:04.000000000 +0200 @@ -1336,13 +1336,12 @@ int bond_enslave(struct net_device *bond goto err_undo_flags; } - new_slave = kmalloc(sizeof(struct slave), GFP_KERNEL); + new_slave = kzalloc(sizeof(struct slave), GFP_KERNEL); if (!new_slave) { res = -ENOMEM; goto err_undo_flags; } - memset(new_slave, 0, sizeof(struct slave)); /* save slave's original flags before calling * netdev_set_master and dev_open diff -rubp linux-2.6.19-rc5_orig/drivers/net/bsd_comp.c linux-2.6.19-rc5_kzalloc/drivers/net/bsd_comp.c --- linux-2.6.19-rc5_orig/drivers/net/bsd_comp.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/bsd_comp.c 2006-11-11 22:44:04.000000000 +0200 @@ -395,14 +395,13 @@ static void *bsd_alloc (unsigned char *o * Allocate the main control structure for this instance. */ maxmaxcode = MAXCODE(bits); - db = (struct bsd_db *) kmalloc (sizeof (struct bsd_db), + db = (struct bsd_db *) kzalloc (sizeof (struct bsd_db), GFP_KERNEL); if (!db) { return NULL; } - memset (db, 0, sizeof(struct bsd_db)); /* * Allocate space for the dictionary. This may be more than one page in * length. diff -rubp linux-2.6.19-rc5_orig/drivers/net/chelsio/mv88x201x.c linux-2.6.19-rc5_kzalloc/drivers/net/chelsio/mv88x201x.c --- linux-2.6.19-rc5_orig/drivers/net/chelsio/mv88x201x.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/chelsio/mv88x201x.c 2006-11-11 22:44:04.000000000 +0200 @@ -205,11 +205,10 @@ static struct cphy *mv88x201x_phy_create struct mdio_ops *mdio_ops) { u32 val; - struct cphy *cphy = kmalloc(sizeof(*cphy), GFP_KERNEL); + struct cphy *cphy = kzalloc(sizeof(*cphy), GFP_KERNEL); if (!cphy) return NULL; - memset(cphy, 0, sizeof(*cphy)); cphy_init(cphy, adapter, phy_addr, &mv88x201x_ops, mdio_ops); /* Commands the PHY to enable XFP's clock. */ diff -rubp linux-2.6.19-rc5_orig/drivers/net/chelsio/sge.c linux-2.6.19-rc5_kzalloc/drivers/net/chelsio/sge.c --- linux-2.6.19-rc5_orig/drivers/net/chelsio/sge.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/chelsio/sge.c 2006-11-11 22:44:04.000000000 +0200 @@ -335,10 +335,9 @@ static int alloc_rx_resources(struct sge goto err_no_mem; memset(q->entries, 0, size); size = sizeof(struct freelQ_ce) * q->size; - q->centries = kmalloc(size, GFP_KERNEL); + q->centries = kzalloc(size, GFP_KERNEL); if (!q->centries) goto err_no_mem; - memset(q->centries, 0, size); } /* @@ -463,10 +462,9 @@ static int alloc_tx_resources(struct sge goto err_no_mem; memset(q->entries, 0, size); size = sizeof(struct cmdQ_ce) * q->size; - q->centries = kmalloc(size, GFP_KERNEL); + q->centries = kzalloc(size, GFP_KERNEL); if (!q->centries) goto err_no_mem; - memset(q->centries, 0, size); } /* @@ -1647,11 +1645,10 @@ static void espibug_workaround(void *dat struct sge * __devinit t1_sge_create(struct adapter *adapter, struct sge_params *p) { - struct sge *sge = kmalloc(sizeof(*sge), GFP_KERNEL); + struct sge *sge = kzalloc(sizeof(*sge), GFP_KERNEL); if (!sge) return NULL; - memset(sge, 0, sizeof(*sge)); sge->adapter = adapter; sge->netdev = adapter->port[0].dev; diff -rubp linux-2.6.19-rc5_orig/drivers/net/e1000/e1000_ethtool.c linux-2.6.19-rc5_kzalloc/drivers/net/e1000/e1000_ethtool.c --- linux-2.6.19-rc5_orig/drivers/net/e1000/e1000_ethtool.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/e1000/e1000_ethtool.c 2006-11-11 22:44:04.000000000 +0200 @@ -1053,11 +1053,10 @@ e1000_setup_desc_rings(struct e1000_adap txdr->count = E1000_DEFAULT_TXD; size = txdr->count * sizeof(struct e1000_buffer); - if (!(txdr->buffer_info = kmalloc(size, GFP_KERNEL))) { + if (!(txdr->buffer_info = kzalloc(size, GFP_KERNEL))) { ret_val = 1; goto err_nomem; } - memset(txdr->buffer_info, 0, size); txdr->size = txdr->count * sizeof(struct e1000_tx_desc); E1000_ROUNDUP(txdr->size, 4096); @@ -1109,11 +1108,10 @@ e1000_setup_desc_rings(struct e1000_adap rxdr->count = E1000_DEFAULT_RXD; size = rxdr->count * sizeof(struct e1000_buffer); - if (!(rxdr->buffer_info = kmalloc(size, GFP_KERNEL))) { + if (!(rxdr->buffer_info = kzalloc(size, GFP_KERNEL))) { ret_val = 4; goto err_nomem; } - memset(rxdr->buffer_info, 0, size); rxdr->size = rxdr->count * sizeof(struct e1000_rx_desc); if (!(rxdr->desc = pci_alloc_consistent(pdev, rxdr->size, &rxdr->dma))) { diff -rubp linux-2.6.19-rc5_orig/drivers/net/e1000/e1000_main.c linux-2.6.19-rc5_kzalloc/drivers/net/e1000/e1000_main.c --- linux-2.6.19-rc5_orig/drivers/net/e1000/e1000_main.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/e1000/e1000_main.c 2006-11-11 22:44:26.000000000 +0200 @@ -1228,28 +1228,25 @@ e1000_alloc_queues(struct e1000_adapter int size; size = sizeof(struct e1000_tx_ring) * adapter->num_tx_queues; - adapter->tx_ring = kmalloc(size, GFP_KERNEL); + adapter->tx_ring = kzalloc(size, GFP_KERNEL); if (!adapter->tx_ring) return -ENOMEM; - memset(adapter->tx_ring, 0, size); size = sizeof(struct e1000_rx_ring) * adapter->num_rx_queues; - adapter->rx_ring = kmalloc(size, GFP_KERNEL); + adapter->rx_ring = kzalloc(size, GFP_KERNEL); if (!adapter->rx_ring) { kfree(adapter->tx_ring); return -ENOMEM; } - memset(adapter->rx_ring, 0, size); #ifdef CONFIG_E1000_NAPI size = sizeof(struct net_device) * adapter->num_rx_queues; - adapter->polling_netdev = kmalloc(size, GFP_KERNEL); + adapter->polling_netdev = kzalloc(size, GFP_KERNEL); if (!adapter->polling_netdev) { kfree(adapter->tx_ring); kfree(adapter->rx_ring); return -ENOMEM; } - memset(adapter->polling_netdev, 0, size); #endif return E1000_SUCCESS; @@ -1626,17 +1623,16 @@ e1000_setup_rx_resources(struct e1000_ad memset(rxdr->buffer_info, 0, size); size = sizeof(struct e1000_ps_page) * rxdr->count; - rxdr->ps_page = kmalloc(size, GFP_KERNEL); + rxdr->ps_page = kzalloc(size, GFP_KERNEL); if (!rxdr->ps_page) { vfree(rxdr->buffer_info); DPRINTK(PROBE, ERR, "Unable to allocate memory for the receive descriptor ring\n"); return -ENOMEM; } - memset(rxdr->ps_page, 0, size); size = sizeof(struct e1000_ps_page_dma) * rxdr->count; - rxdr->ps_page_dma = kmalloc(size, GFP_KERNEL); + rxdr->ps_page_dma = kzalloc(size, GFP_KERNEL); if (!rxdr->ps_page_dma) { vfree(rxdr->buffer_info); kfree(rxdr->ps_page); @@ -1644,7 +1640,6 @@ e1000_setup_rx_resources(struct e1000_ad "Unable to allocate memory for the receive descriptor ring\n"); return -ENOMEM; } - memset(rxdr->ps_page_dma, 0, size); if (adapter->hw.mac_type <= e1000_82547_rev_2) desc_len = sizeof(struct e1000_rx_desc); diff -rubp linux-2.6.19-rc5_orig/drivers/net/e100.c linux-2.6.19-rc5_kzalloc/drivers/net/e100.c --- linux-2.6.19-rc5_orig/drivers/net/e100.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/e100.c 2006-11-11 22:44:04.000000000 +0200 @@ -1930,9 +1930,8 @@ static int e100_rx_alloc_list(struct nic nic->rx_to_use = nic->rx_to_clean = NULL; nic->ru_running = RU_UNINITIALIZED; - if(!(nic->rxs = kmalloc(sizeof(struct rx) * count, GFP_ATOMIC))) + if(!(nic->rxs = kzalloc(sizeof(struct rx) * count, GFP_ATOMIC))) return -ENOMEM; - memset(nic->rxs, 0, sizeof(struct rx) * count); for(rx = nic->rxs, i = 0; i < count; rx++, i++) { rx->next = (i + 1 < count) ? rx + 1 : nic->rxs; diff -rubp linux-2.6.19-rc5_orig/drivers/net/eql.c linux-2.6.19-rc5_kzalloc/drivers/net/eql.c --- linux-2.6.19-rc5_orig/drivers/net/eql.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/eql.c 2006-11-11 22:44:18.000000000 +0200 @@ -418,7 +418,7 @@ static int eql_enslave(struct net_device /* slave is not a master & not already a slave: */ if (!eql_is_master(slave_dev) && !eql_is_slave(slave_dev)) { - slave_t *s = kmalloc(sizeof(*s), GFP_KERNEL); + slave_t *s = kzalloc(sizeof(*s), GFP_KERNEL); equalizer_t *eql = netdev_priv(master_dev); int ret; @@ -427,7 +427,6 @@ static int eql_enslave(struct net_device return -ENOMEM; } - memset(s, 0, sizeof(*s)); s->dev = slave_dev; s->priority = srq.priority; s->priority_bps = srq.priority; diff -rubp linux-2.6.19-rc5_orig/drivers/net/forcedeth.c linux-2.6.19-rc5_kzalloc/drivers/net/forcedeth.c --- linux-2.6.19-rc5_orig/drivers/net/forcedeth.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/forcedeth.c 2006-11-11 22:44:04.000000000 +0200 @@ -4383,18 +4383,13 @@ static int __devinit nv_probe(struct pci goto out_unmap; np->tx_ring.ex = &np->rx_ring.ex[np->rx_ring_size]; } - np->rx_skbuff = kmalloc(sizeof(struct sk_buff*) * np->rx_ring_size, GFP_KERNEL); - np->rx_dma = kmalloc(sizeof(dma_addr_t) * np->rx_ring_size, GFP_KERNEL); - np->tx_skbuff = kmalloc(sizeof(struct sk_buff*) * np->tx_ring_size, GFP_KERNEL); - np->tx_dma = kmalloc(sizeof(dma_addr_t) * np->tx_ring_size, GFP_KERNEL); - np->tx_dma_len = kmalloc(sizeof(unsigned int) * np->tx_ring_size, GFP_KERNEL); + np->rx_skbuff = kzalloc(sizeof(struct sk_buff*) * np->rx_ring_size, GFP_KERNEL); + np->rx_dma = kzalloc(sizeof(dma_addr_t) * np->rx_ring_size, GFP_KERNEL); + np->tx_skbuff = kzalloc(sizeof(struct sk_buff*) * np->tx_ring_size, GFP_KERNEL); + np->tx_dma = kzalloc(sizeof(dma_addr_t) * np->tx_ring_size, GFP_KERNEL); + np->tx_dma_len = kzalloc(sizeof(unsigned int) * np->tx_ring_size, GFP_KERNEL); if (!np->rx_skbuff || !np->rx_dma || !np->tx_skbuff || !np->tx_dma || !np->tx_dma_len) goto out_freering; - memset(np->rx_skbuff, 0, sizeof(struct sk_buff*) * np->rx_ring_size); - memset(np->rx_dma, 0, sizeof(dma_addr_t) * np->rx_ring_size); - memset(np->tx_skbuff, 0, sizeof(struct sk_buff*) * np->tx_ring_size); - memset(np->tx_dma, 0, sizeof(dma_addr_t) * np->tx_ring_size); - memset(np->tx_dma_len, 0, sizeof(unsigned int) * np->tx_ring_size); dev->open = nv_open; dev->stop = nv_close; diff -rubp linux-2.6.19-rc5_orig/drivers/net/hamradio/dmascc.c linux-2.6.19-rc5_kzalloc/drivers/net/hamradio/dmascc.c --- linux-2.6.19-rc5_orig/drivers/net/hamradio/dmascc.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/hamradio/dmascc.c 2006-11-11 22:44:18.000000000 +0200 @@ -460,7 +460,7 @@ static int __init setup_adapter(int card char *chipnames[] = CHIPNAMES; /* Allocate memory */ - info = kmalloc(sizeof(struct scc_info), GFP_KERNEL | GFP_DMA); + info = kzalloc(sizeof(struct scc_info), GFP_KERNEL | GFP_DMA); if (!info) { printk(KERN_ERR "dmascc: " "could not allocate memory for %s at %#3x\n", @@ -469,8 +469,6 @@ static int __init setup_adapter(int card } /* Initialize what is necessary for write_scc and write_scc_data */ - memset(info, 0, sizeof(struct scc_info)); - info->dev[0] = alloc_netdev(0, "", dev_setup); if (!info->dev[0]) { printk(KERN_ERR "dmascc: " diff -rubp linux-2.6.19-rc5_orig/drivers/net/irda/irda-usb.c linux-2.6.19-rc5_kzalloc/drivers/net/irda/irda-usb.c --- linux-2.6.19-rc5_orig/drivers/net/irda/irda-usb.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/irda/irda-usb.c 2006-11-11 22:44:04.000000000 +0200 @@ -1570,10 +1570,9 @@ static inline struct irda_class_desc *ir struct irda_class_desc *desc; int ret; - desc = kmalloc(sizeof (*desc), GFP_KERNEL); + desc = kzalloc(sizeof (*desc), GFP_KERNEL); if (desc == NULL) return NULL; - memset(desc, 0, sizeof(*desc)); /* USB-IrDA class spec 1.0: * 6.1.3: Standard "Get Descriptor" Device Request is not @@ -1747,12 +1746,10 @@ static int irda_usb_probe(struct usb_int /* Don't change this buffer size and allocation without doing * some heavy and complete testing. Don't ask why :-( * Jean II */ - self->speed_buff = (char *) kmalloc(IRDA_USB_SPEED_MTU, GFP_KERNEL); + self->speed_buff = (char *) kzalloc(IRDA_USB_SPEED_MTU, GFP_KERNEL); if (self->speed_buff == NULL) goto err_out_3; - memset(self->speed_buff, 0, IRDA_USB_SPEED_MTU); - ret = irda_usb_open(self); if (ret) goto err_out_4; diff -rubp linux-2.6.19-rc5_orig/drivers/net/irda/irport.c linux-2.6.19-rc5_kzalloc/drivers/net/irda/irport.c --- linux-2.6.19-rc5_orig/drivers/net/irda/irport.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/irda/irport.c 2006-11-11 22:44:04.000000000 +0200 @@ -164,14 +164,13 @@ irport_open(int i, unsigned int iobase, /* Allocate memory if needed */ if (self->tx_buff.truesize > 0) { - self->tx_buff.head = (__u8 *) kmalloc(self->tx_buff.truesize, + self->tx_buff.head = (__u8 *) kzalloc(self->tx_buff.truesize, GFP_KERNEL); if (self->tx_buff.head == NULL) { IRDA_ERROR("%s(), can't allocate memory for " "transmit buffer!\n", __FUNCTION__); goto err_out4; } - memset(self->tx_buff.head, 0, self->tx_buff.truesize); } self->tx_buff.data = self->tx_buff.head; diff -rubp linux-2.6.19-rc5_orig/drivers/net/irda/irtty-sir.c linux-2.6.19-rc5_kzalloc/drivers/net/irda/irtty-sir.c --- linux-2.6.19-rc5_orig/drivers/net/irda/irtty-sir.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/irda/irtty-sir.c 2006-11-11 22:44:04.000000000 +0200 @@ -505,10 +505,9 @@ static int irtty_open(struct tty_struct } /* allocate private device info block */ - priv = kmalloc(sizeof(*priv), GFP_KERNEL); + priv = kzalloc(sizeof(*priv), GFP_KERNEL); if (!priv) goto out_put; - memset(priv, 0, sizeof(*priv)); priv->magic = IRTTY_MAGIC; priv->tty = tty; diff -rubp linux-2.6.19-rc5_orig/drivers/net/iseries_veth.c linux-2.6.19-rc5_kzalloc/drivers/net/iseries_veth.c --- linux-2.6.19-rc5_orig/drivers/net/iseries_veth.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/iseries_veth.c 2006-11-11 22:44:04.000000000 +0200 @@ -820,10 +820,9 @@ static int veth_init_connection(u8 rlp) || ! HvLpConfig_doLpsCommunicateOnVirtualLan(this_lp, rlp) ) return 0; - cnx = kmalloc(sizeof(*cnx), GFP_KERNEL); + cnx = kzalloc(sizeof(*cnx), GFP_KERNEL); if (! cnx) return -ENOMEM; - memset(cnx, 0, sizeof(*cnx)); cnx->remote_lp = rlp; spin_lock_init(&cnx->lock); @@ -850,14 +849,13 @@ static int veth_init_connection(u8 rlp) if (rc != 0) return rc; - msgs = kmalloc(VETH_NUMBUFFERS * sizeof(struct veth_msg), GFP_KERNEL); + msgs = kzalloc(VETH_NUMBUFFERS * sizeof(struct veth_msg), GFP_KERNEL); if (! msgs) { veth_error("Can't allocate buffers for LPAR %d.\n", rlp); return -ENOMEM; } cnx->msgs = msgs; - memset(msgs, 0, VETH_NUMBUFFERS * sizeof(struct veth_msg)); for (i = 0; i < VETH_NUMBUFFERS; i++) { msgs[i].token = i; diff -rubp linux-2.6.19-rc5_orig/drivers/net/lance.c linux-2.6.19-rc5_kzalloc/drivers/net/lance.c --- linux-2.6.19-rc5_orig/drivers/net/lance.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/lance.c 2006-11-11 22:44:04.000000000 +0200 @@ -532,11 +532,10 @@ static int __init lance_probe1(struct ne dev->base_addr = ioaddr; /* Make certain the data structures used by the LANCE are aligned and DMAble. */ - lp = kmalloc(sizeof(*lp), GFP_DMA | GFP_KERNEL); + lp = kzalloc(sizeof(*lp), GFP_DMA | GFP_KERNEL); if(lp==NULL) return -ENODEV; if (lance_debug > 6) printk(" (#0x%05lx)", (unsigned long)lp); - memset(lp, 0, sizeof(*lp)); dev->priv = lp; lp->name = chipname; lp->rx_buffs = (unsigned long)kmalloc(PKT_BUF_SZ*RX_RING_SIZE, diff -rubp linux-2.6.19-rc5_orig/drivers/net/mipsnet.c linux-2.6.19-rc5_kzalloc/drivers/net/mipsnet.c --- linux-2.6.19-rc5_orig/drivers/net/mipsnet.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/mipsnet.c 2006-11-11 22:44:04.000000000 +0200 @@ -322,12 +322,11 @@ static int __init mipsnet_init_module(vo goto out; } - if (!(pldev = kmalloc (sizeof (*pldev), GFP_KERNEL))) { + if (!(pldev = kzalloc (sizeof (*pldev), GFP_KERNEL))) { err = -ENOMEM; goto out_unregister_driver; } - memset (pldev, 0, sizeof (*pldev)); pldev->name = mipsnet_string; pldev->id = 0; pldev->dev.release = mipsnet_platform_release; diff -rubp linux-2.6.19-rc5_orig/drivers/net/pcmcia/com20020_cs.c linux-2.6.19-rc5_kzalloc/drivers/net/pcmcia/com20020_cs.c --- linux-2.6.19-rc5_orig/drivers/net/pcmcia/com20020_cs.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/pcmcia/com20020_cs.c 2006-11-11 22:44:18.000000000 +0200 @@ -147,7 +147,7 @@ static int com20020_probe(struct pcmcia_ DEBUG(0, "com20020_attach()\n"); /* Create new network device */ - info = kmalloc(sizeof(struct com20020_dev_t), GFP_KERNEL); + info = kzalloc(sizeof(struct com20020_dev_t), GFP_KERNEL); if (!info) goto fail_alloc_info; @@ -155,7 +155,6 @@ static int com20020_probe(struct pcmcia_ if (!dev) goto fail_alloc_dev; - memset(info, 0, sizeof(struct com20020_dev_t)); lp = dev->priv; lp->timeout = timeout; lp->backplane = backplane; diff -rubp linux-2.6.19-rc5_orig/drivers/net/pcmcia/ibmtr_cs.c linux-2.6.19-rc5_kzalloc/drivers/net/pcmcia/ibmtr_cs.c --- linux-2.6.19-rc5_orig/drivers/net/pcmcia/ibmtr_cs.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/pcmcia/ibmtr_cs.c 2006-11-11 22:44:04.000000000 +0200 @@ -146,9 +146,8 @@ static int ibmtr_attach(struct pcmcia_de DEBUG(0, "ibmtr_attach()\n"); /* Create new token-ring device */ - info = kmalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc(sizeof(*info), GFP_KERNEL); if (!info) return -ENOMEM; - memset(info,0,sizeof(*info)); dev = alloc_trdev(sizeof(struct tok_info)); if (!dev) { kfree(info); diff -rubp linux-2.6.19-rc5_orig/drivers/net/ppp_async.c linux-2.6.19-rc5_kzalloc/drivers/net/ppp_async.c --- linux-2.6.19-rc5_orig/drivers/net/ppp_async.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/ppp_async.c 2006-11-11 22:44:04.000000000 +0200 @@ -159,12 +159,11 @@ ppp_asynctty_open(struct tty_struct *tty int err; err = -ENOMEM; - ap = kmalloc(sizeof(*ap), GFP_KERNEL); + ap = kzalloc(sizeof(*ap), GFP_KERNEL); if (ap == 0) goto out; /* initialize the asyncppp structure */ - memset(ap, 0, sizeof(*ap)); ap->tty = tty; ap->mru = PPP_MRU; spin_lock_init(&ap->xmit_lock); diff -rubp linux-2.6.19-rc5_orig/drivers/net/ppp_deflate.c linux-2.6.19-rc5_kzalloc/drivers/net/ppp_deflate.c --- linux-2.6.19-rc5_orig/drivers/net/ppp_deflate.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/ppp_deflate.c 2006-11-11 22:44:04.000000000 +0200 @@ -121,12 +121,11 @@ static void *z_comp_alloc(unsigned char if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE) return NULL; - state = (struct ppp_deflate_state *) kmalloc(sizeof(*state), + state = (struct ppp_deflate_state *) kzalloc(sizeof(*state), GFP_KERNEL); if (state == NULL) return NULL; - memset (state, 0, sizeof (struct ppp_deflate_state)); state->strm.next_in = NULL; state->w_size = w_size; state->strm.workspace = vmalloc(zlib_deflate_workspacesize()); @@ -341,11 +340,10 @@ static void *z_decomp_alloc(unsigned cha if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE) return NULL; - state = (struct ppp_deflate_state *) kmalloc(sizeof(*state), GFP_KERNEL); + state = (struct ppp_deflate_state *) kzalloc(sizeof(*state), GFP_KERNEL); if (state == NULL) return NULL; - memset (state, 0, sizeof (struct ppp_deflate_state)); state->w_size = w_size; state->strm.next_out = NULL; state->strm.workspace = kmalloc(zlib_inflate_workspacesize(), diff -rubp linux-2.6.19-rc5_orig/drivers/net/ppp_mppe.c linux-2.6.19-rc5_kzalloc/drivers/net/ppp_mppe.c --- linux-2.6.19-rc5_orig/drivers/net/ppp_mppe.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/ppp_mppe.c 2006-11-11 22:44:04.000000000 +0200 @@ -200,12 +200,10 @@ static void *mppe_alloc(unsigned char *o || options[0] != CI_MPPE || options[1] != CILEN_MPPE) goto out; - state = (struct ppp_mppe_state *) kmalloc(sizeof(*state), GFP_KERNEL); + state = (struct ppp_mppe_state *) kzalloc(sizeof(*state), GFP_KERNEL); if (state == NULL) goto out; - memset(state, 0, sizeof(*state)); - state->arc4 = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC); if (IS_ERR(state->arc4)) { state->arc4 = NULL; diff -rubp linux-2.6.19-rc5_orig/drivers/net/ppp_synctty.c linux-2.6.19-rc5_kzalloc/drivers/net/ppp_synctty.c --- linux-2.6.19-rc5_orig/drivers/net/ppp_synctty.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/ppp_synctty.c 2006-11-11 22:44:04.000000000 +0200 @@ -207,13 +207,12 @@ ppp_sync_open(struct tty_struct *tty) struct syncppp *ap; int err; - ap = kmalloc(sizeof(*ap), GFP_KERNEL); + ap = kzalloc(sizeof(*ap), GFP_KERNEL); err = -ENOMEM; if (ap == 0) goto out; /* initialize the syncppp structure */ - memset(ap, 0, sizeof(*ap)); ap->tty = tty; ap->mru = PPP_MRU; spin_lock_init(&ap->xmit_lock); diff -rubp linux-2.6.19-rc5_orig/drivers/net/s2io.c linux-2.6.19-rc5_kzalloc/drivers/net/s2io.c --- linux-2.6.19-rc5_orig/drivers/net/s2io.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/s2io.c 2006-11-11 22:44:04.000000000 +0200 @@ -3647,24 +3647,21 @@ static int s2io_enable_msi_x(nic_t *nic) u16 msi_control; /* Temp variable */ int ret, i, j, msix_indx = 1; - nic->entries = kmalloc(MAX_REQUESTED_MSI_X * sizeof(struct msix_entry), + nic->entries = kzalloc(MAX_REQUESTED_MSI_X * sizeof(struct msix_entry), GFP_KERNEL); if (nic->entries == NULL) { DBG_PRINT(ERR_DBG, "%s: Memory allocation failed\n", __FUNCTION__); return -ENOMEM; } - memset(nic->entries, 0, MAX_REQUESTED_MSI_X * sizeof(struct msix_entry)); nic->s2io_entries = - kmalloc(MAX_REQUESTED_MSI_X * sizeof(struct s2io_msix_entry), + kzalloc(MAX_REQUESTED_MSI_X * sizeof(struct s2io_msix_entry), GFP_KERNEL); if (nic->s2io_entries == NULL) { DBG_PRINT(ERR_DBG, "%s: Memory allocation failed\n", __FUNCTION__); kfree(nic->entries); return -ENOMEM; } - memset(nic->s2io_entries, 0, - MAX_REQUESTED_MSI_X * sizeof(struct s2io_msix_entry)); for (i=0; i< MAX_REQUESTED_MSI_X; i++) { nic->entries[i].entry = i; diff -rubp linux-2.6.19-rc5_orig/drivers/net/sb1250-mac.c linux-2.6.19-rc5_kzalloc/drivers/net/sb1250-mac.c --- linux-2.6.19-rc5_orig/drivers/net/sb1250-mac.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/sb1250-mac.c 2006-11-11 22:44:04.000000000 +0200 @@ -756,9 +756,7 @@ static void sbdma_initctx(sbmacdma_t *d, */ d->sbdma_ctxtable = (struct sk_buff **) - kmalloc(d->sbdma_maxdescr*sizeof(struct sk_buff *), GFP_KERNEL); - - memset(d->sbdma_ctxtable,0,d->sbdma_maxdescr*sizeof(struct sk_buff *)); + kzalloc(d->sbdma_maxdescr*sizeof(struct sk_buff *), GFP_KERNEL); #ifdef CONFIG_SBMAC_COALESCE /* diff -rubp linux-2.6.19-rc5_orig/drivers/net/shaper.c linux-2.6.19-rc5_kzalloc/drivers/net/shaper.c --- linux-2.6.19-rc5_orig/drivers/net/shaper.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/shaper.c 2006-11-11 22:44:04.000000000 +0200 @@ -600,10 +600,9 @@ static int __init shaper_init(void) return -ENODEV; alloc_size = sizeof(*dev) * shapers; - devs = kmalloc(alloc_size, GFP_KERNEL); + devs = kzalloc(alloc_size, GFP_KERNEL); if (!devs) return -ENOMEM; - memset(devs, 0, alloc_size); for (i = 0; i < shapers; i++) { diff -rubp linux-2.6.19-rc5_orig/drivers/net/slip.c linux-2.6.19-rc5_kzalloc/drivers/net/slip.c --- linux-2.6.19-rc5_orig/drivers/net/slip.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/slip.c 2006-11-11 22:44:04.000000000 +0200 @@ -1343,15 +1343,13 @@ static int __init slip_init(void) printk(KERN_INFO "SLIP linefill/keepalive option.\n"); #endif - slip_devs = kmalloc(sizeof(struct net_device *)*slip_maxdev, GFP_KERNEL); + /* Clear the pointer array, we allocate devices when we need them */ + slip_devs = kzalloc(sizeof(struct net_device *)*slip_maxdev, GFP_KERNEL); if (!slip_devs) { printk(KERN_ERR "SLIP: Can't allocate slip devices array! Uaargh! (-> No SLIP available)\n"); return -ENOMEM; } - /* Clear the pointer array, we allocate devices when we need them */ - memset(slip_devs, 0, sizeof(struct net_device *)*slip_maxdev); - /* Fill in our line protocol discipline, and register it */ if ((status = tty_register_ldisc(N_SLIP, &sl_ldisc)) != 0) { printk(KERN_ERR "SLIP: can't register line discipline (err = %d)\n", status); diff -rubp linux-2.6.19-rc5_orig/drivers/net/tg3.c linux-2.6.19-rc5_kzalloc/drivers/net/tg3.c --- linux-2.6.19-rc5_orig/drivers/net/tg3.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/tg3.c 2006-11-11 22:44:18.000000000 +0200 @@ -4416,7 +4416,7 @@ static void tg3_free_consistent(struct t */ static int tg3_alloc_consistent(struct tg3 *tp) { - tp->rx_std_buffers = kmalloc((sizeof(struct ring_info) * + tp->rx_std_buffers = kzalloc((sizeof(struct ring_info) * (TG3_RX_RING_SIZE + TG3_RX_JUMBO_RING_SIZE)) + (sizeof(struct tx_ring_info) * @@ -4425,13 +4425,6 @@ static int tg3_alloc_consistent(struct t if (!tp->rx_std_buffers) return -ENOMEM; - memset(tp->rx_std_buffers, 0, - (sizeof(struct ring_info) * - (TG3_RX_RING_SIZE + - TG3_RX_JUMBO_RING_SIZE)) + - (sizeof(struct tx_ring_info) * - TG3_TX_RING_SIZE)); - tp->rx_jumbo_buffers = &tp->rx_std_buffers[TG3_RX_RING_SIZE]; tp->tx_buffers = (struct tx_ring_info *) &tp->rx_jumbo_buffers[TG3_RX_JUMBO_RING_SIZE]; diff -rubp linux-2.6.19-rc5_orig/drivers/net/via-velocity.c linux-2.6.19-rc5_kzalloc/drivers/net/via-velocity.c --- linux-2.6.19-rc5_orig/drivers/net/via-velocity.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/via-velocity.c 2006-11-11 22:44:04.000000000 +0200 @@ -1072,10 +1072,9 @@ static int velocity_init_rd_ring(struct unsigned int rsize = sizeof(struct velocity_rd_info) * vptr->options.numrx; - vptr->rd_info = kmalloc(rsize, GFP_KERNEL); + vptr->rd_info = kzalloc(rsize, GFP_KERNEL); if(vptr->rd_info == NULL) goto out; - memset(vptr->rd_info, 0, rsize); vptr->rd_filled = vptr->rd_dirty = vptr->rd_curr = 0; @@ -1146,14 +1145,13 @@ static int velocity_init_td_ring(struct for (j = 0; j < vptr->num_txq; j++) { curr = vptr->td_pool_dma[j]; - vptr->td_infos[j] = kmalloc(tsize, GFP_KERNEL); + vptr->td_infos[j] = kzalloc(tsize, GFP_KERNEL); if(vptr->td_infos[j] == NULL) { while(--j >= 0) kfree(vptr->td_infos[j]); return -ENOMEM; } - memset(vptr->td_infos[j], 0, tsize); for (i = 0; i < vptr->options.numtx; i++, curr += sizeof(struct tx_desc)) { td = &(vptr->td_rings[j][i]); diff -rubp linux-2.6.19-rc5_orig/drivers/net/wan/c101.c linux-2.6.19-rc5_kzalloc/drivers/net/wan/c101.c --- linux-2.6.19-rc5_orig/drivers/net/wan/c101.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/wan/c101.c 2006-11-11 22:44:04.000000000 +0200 @@ -315,12 +315,11 @@ static int __init c101_run(unsigned long return -ENODEV; } - card = kmalloc(sizeof(card_t), GFP_KERNEL); + card = kzalloc(sizeof(card_t), GFP_KERNEL); if (card == NULL) { printk(KERN_ERR "c101: unable to allocate memory\n"); return -ENOBUFS; } - memset(card, 0, sizeof(card_t)); card->dev = alloc_hdlcdev(card); if (!card->dev) { diff -rubp linux-2.6.19-rc5_orig/drivers/net/wan/cosa.c linux-2.6.19-rc5_kzalloc/drivers/net/wan/cosa.c --- linux-2.6.19-rc5_orig/drivers/net/wan/cosa.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/wan/cosa.c 2006-11-11 22:44:04.000000000 +0200 @@ -574,13 +574,12 @@ static int cosa_probe(int base, int irq, sprintf(cosa->name, "cosa%d", cosa->num); /* Initialize the per-channel data */ - cosa->chan = kmalloc(sizeof(struct channel_data)*cosa->nchannels, + cosa->chan = kzalloc(sizeof(struct channel_data)*cosa->nchannels, GFP_KERNEL); if (!cosa->chan) { err = -ENOMEM; goto err_out3; } - memset(cosa->chan, 0, sizeof(struct channel_data)*cosa->nchannels); for (i=0; inchannels; i++) { cosa->chan[i].cosa = cosa; cosa->chan[i].num = i; diff -rubp linux-2.6.19-rc5_orig/drivers/net/wan/cycx_main.c linux-2.6.19-rc5_kzalloc/drivers/net/wan/cycx_main.c --- linux-2.6.19-rc5_orig/drivers/net/wan/cycx_main.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/wan/cycx_main.c 2006-11-11 22:44:04.000000000 +0200 @@ -113,13 +113,11 @@ static int __init cycx_init(void) /* Verify number of cards and allocate adapter data space */ cycx_ncards = min_t(int, cycx_ncards, CYCX_MAX_CARDS); cycx_ncards = max_t(int, cycx_ncards, 1); - cycx_card_array = kmalloc(sizeof(struct cycx_device) * cycx_ncards, + cycx_card_array = kzalloc(sizeof(struct cycx_device) * cycx_ncards, GFP_KERNEL); if (!cycx_card_array) goto out; - memset(cycx_card_array, 0, sizeof(struct cycx_device) * cycx_ncards); - /* Register adapters with WAN router */ for (cnt = 0; cnt < cycx_ncards; ++cnt) { struct cycx_device *card = &cycx_card_array[cnt]; diff -rubp linux-2.6.19-rc5_orig/drivers/net/wan/cycx_x25.c linux-2.6.19-rc5_kzalloc/drivers/net/wan/cycx_x25.c --- linux-2.6.19-rc5_orig/drivers/net/wan/cycx_x25.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/wan/cycx_x25.c 2006-11-11 22:44:04.000000000 +0200 @@ -376,11 +376,10 @@ static int cycx_wan_new_if(struct wan_de } /* allocate and initialize private data */ - chan = kmalloc(sizeof(struct cycx_x25_channel), GFP_KERNEL); + chan = kzalloc(sizeof(struct cycx_x25_channel), GFP_KERNEL); if (!chan) return -ENOMEM; - memset(chan, 0, sizeof(*chan)); strcpy(chan->name, conf->name); chan->card = card; chan->link = conf->port; diff -rubp linux-2.6.19-rc5_orig/drivers/net/wan/dscc4.c linux-2.6.19-rc5_kzalloc/drivers/net/wan/dscc4.c --- linux-2.6.19-rc5_orig/drivers/net/wan/dscc4.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/wan/dscc4.c 2006-11-11 22:44:04.000000000 +0200 @@ -890,12 +890,11 @@ static int dscc4_found1(struct pci_dev * struct dscc4_dev_priv *root; int i, ret = -ENOMEM; - root = kmalloc(dev_per_card*sizeof(*root), GFP_KERNEL); + root = kzalloc(dev_per_card*sizeof(*root), GFP_KERNEL); if (!root) { printk(KERN_ERR "%s: can't allocate data\n", DRV_NAME); goto err_out; } - memset(root, 0, dev_per_card*sizeof(*root)); for (i = 0; i < dev_per_card; i++) { root[i].dev = alloc_hdlcdev(root + i); @@ -903,12 +902,11 @@ static int dscc4_found1(struct pci_dev * goto err_free_dev; } - ppriv = kmalloc(sizeof(*ppriv), GFP_KERNEL); + ppriv = kzalloc(sizeof(*ppriv), GFP_KERNEL); if (!ppriv) { printk(KERN_ERR "%s: can't allocate private data\n", DRV_NAME); goto err_free_dev; } - memset(ppriv, 0, sizeof(struct dscc4_pci_priv)); ppriv->root = root; spin_lock_init(&ppriv->lock); diff -rubp linux-2.6.19-rc5_orig/drivers/net/wan/farsync.c linux-2.6.19-rc5_kzalloc/drivers/net/wan/farsync.c --- linux-2.6.19-rc5_orig/drivers/net/wan/farsync.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/wan/farsync.c 2006-11-11 22:44:04.000000000 +0200 @@ -2476,13 +2476,12 @@ fst_add_one(struct pci_dev *pdev, const } /* Allocate driver private data */ - card = kmalloc(sizeof (struct fst_card_info), GFP_KERNEL); + card = kzalloc(sizeof (struct fst_card_info), GFP_KERNEL); if (card == NULL) { printk_err("FarSync card found but insufficient memory for" " driver storage\n"); return -ENOMEM; } - memset(card, 0, sizeof (struct fst_card_info)); /* Try to enable the device */ if ((err = pci_enable_device(pdev)) != 0) { diff -rubp linux-2.6.19-rc5_orig/drivers/net/wan/hdlc_fr.c linux-2.6.19-rc5_kzalloc/drivers/net/wan/hdlc_fr.c --- linux-2.6.19-rc5_orig/drivers/net/wan/hdlc_fr.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/wan/hdlc_fr.c 2006-11-11 22:44:04.000000000 +0200 @@ -212,14 +212,13 @@ static pvc_device* add_pvc(struct net_de pvc_p = &(*pvc_p)->next; } - pvc = kmalloc(sizeof(pvc_device), GFP_ATOMIC); + pvc = kzalloc(sizeof(pvc_device), GFP_ATOMIC); #ifdef DEBUG_PVC printk(KERN_DEBUG "add_pvc: allocated pvc %p, frad %p\n", pvc, dev); #endif if (!pvc) return NULL; - memset(pvc, 0, sizeof(pvc_device)); pvc->dlci = dlci; pvc->frad = dev; pvc->next = *pvc_p; /* Put it in the chain */ diff -rubp linux-2.6.19-rc5_orig/drivers/net/wan/hostess_sv11.c linux-2.6.19-rc5_kzalloc/drivers/net/wan/hostess_sv11.c --- linux-2.6.19-rc5_orig/drivers/net/wan/hostess_sv11.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/wan/hostess_sv11.c 2006-11-11 22:44:04.000000000 +0200 @@ -231,11 +231,10 @@ static struct sv11_device *sv11_init(int return NULL; } - sv=(struct sv11_device *)kmalloc(sizeof(struct sv11_device), GFP_KERNEL); + sv=(struct sv11_device *)kzalloc(sizeof(struct sv11_device), GFP_KERNEL); if(!sv) goto fail3; - memset(sv, 0, sizeof(*sv)); sv->if_ptr=&sv->netdev; sv->netdev.dev = alloc_netdev(0, "hdlc%d", sv11_setup); diff -rubp linux-2.6.19-rc5_orig/drivers/net/wan/n2.c linux-2.6.19-rc5_kzalloc/drivers/net/wan/n2.c --- linux-2.6.19-rc5_orig/drivers/net/wan/n2.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/wan/n2.c 2006-11-11 22:44:04.000000000 +0200 @@ -351,12 +351,11 @@ static int __init n2_run(unsigned long i return -ENODEV; } - card = kmalloc(sizeof(card_t), GFP_KERNEL); + card = kzalloc(sizeof(card_t), GFP_KERNEL); if (card == NULL) { printk(KERN_ERR "n2: unable to allocate memory\n"); return -ENOBUFS; } - memset(card, 0, sizeof(card_t)); card->ports[0].dev = alloc_hdlcdev(&card->ports[0]); card->ports[1].dev = alloc_hdlcdev(&card->ports[1]); diff -rubp linux-2.6.19-rc5_orig/drivers/net/wan/pc300_drv.c linux-2.6.19-rc5_kzalloc/drivers/net/wan/pc300_drv.c --- linux-2.6.19-rc5_orig/drivers/net/wan/pc300_drv.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/wan/pc300_drv.c 2006-11-11 22:44:18.000000000 +0200 @@ -3455,7 +3455,7 @@ cpc_init_one(struct pci_dev *pdev, const if ((err = pci_enable_device(pdev)) < 0) return err; - card = (pc300_t *) kmalloc(sizeof(pc300_t), GFP_KERNEL); + card = (pc300_t *) kzalloc(sizeof(pc300_t), GFP_KERNEL); if (card == NULL) { printk("PC300 found at RAM 0x%016llx, " "but could not allocate card structure.\n", @@ -3463,7 +3463,6 @@ cpc_init_one(struct pci_dev *pdev, const err = -ENOMEM; goto err_disable_dev; } - memset(card, 0, sizeof(pc300_t)); err = -ENODEV; diff -rubp linux-2.6.19-rc5_orig/drivers/net/wan/pci200syn.c linux-2.6.19-rc5_kzalloc/drivers/net/wan/pci200syn.c --- linux-2.6.19-rc5_orig/drivers/net/wan/pci200syn.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/wan/pci200syn.c 2006-11-11 22:44:04.000000000 +0200 @@ -314,14 +314,13 @@ static int __devinit pci200_pci_init_one return i; } - card = kmalloc(sizeof(card_t), GFP_KERNEL); + card = kzalloc(sizeof(card_t), GFP_KERNEL); if (card == NULL) { printk(KERN_ERR "pci200syn: unable to allocate memory\n"); pci_release_regions(pdev); pci_disable_device(pdev); return -ENOBUFS; } - memset(card, 0, sizeof(card_t)); pci_set_drvdata(pdev, card); card->ports[0].dev = alloc_hdlcdev(&card->ports[0]); card->ports[1].dev = alloc_hdlcdev(&card->ports[1]); diff -rubp linux-2.6.19-rc5_orig/drivers/net/wan/sdla.c linux-2.6.19-rc5_kzalloc/drivers/net/wan/sdla.c --- linux-2.6.19-rc5_orig/drivers/net/wan/sdla.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/wan/sdla.c 2006-11-11 22:44:04.000000000 +0200 @@ -1196,10 +1196,9 @@ static int sdla_xfer(struct net_device * if (read) { - temp = kmalloc(mem.len, GFP_KERNEL); + temp = kzalloc(mem.len, GFP_KERNEL); if (!temp) return(-ENOMEM); - memset(temp, 0, mem.len); sdla_read(dev, mem.addr, temp, mem.len); if(copy_to_user(mem.data, temp, mem.len)) { diff -rubp linux-2.6.19-rc5_orig/drivers/net/wan/sealevel.c linux-2.6.19-rc5_kzalloc/drivers/net/wan/sealevel.c --- linux-2.6.19-rc5_orig/drivers/net/wan/sealevel.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/wan/sealevel.c 2006-11-11 22:44:04.000000000 +0200 @@ -270,11 +270,10 @@ static __init struct slvl_board *slvl_in return NULL; } - b = kmalloc(sizeof(struct slvl_board), GFP_KERNEL); + b = kzalloc(sizeof(struct slvl_board), GFP_KERNEL); if(!b) goto fail3; - memset(b, 0, sizeof(*b)); if (!(b->dev[0]= slvl_alloc(iobase, irq))) goto fail2; diff -rubp linux-2.6.19-rc5_orig/drivers/net/wan/wanxl.c linux-2.6.19-rc5_kzalloc/drivers/net/wan/wanxl.c --- linux-2.6.19-rc5_orig/drivers/net/wan/wanxl.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/wan/wanxl.c 2006-11-11 22:44:18.000000000 +0200 @@ -599,7 +599,7 @@ static int __devinit wanxl_pci_init_one( } alloc_size = sizeof(card_t) + ports * sizeof(port_t); - card = kmalloc(alloc_size, GFP_KERNEL); + card = kzalloc(alloc_size, GFP_KERNEL); if (card == NULL) { printk(KERN_ERR "wanXL %s: unable to allocate memory\n", pci_name(pdev)); @@ -607,7 +607,6 @@ static int __devinit wanxl_pci_init_one( pci_disable_device(pdev); return -ENOBUFS; } - memset(card, 0, alloc_size); pci_set_drvdata(pdev, card); card->pdev = pdev; diff -rubp linux-2.6.19-rc5_orig/drivers/net/wan/x25_asy.c linux-2.6.19-rc5_kzalloc/drivers/net/wan/x25_asy.c --- linux-2.6.19-rc5_orig/drivers/net/wan/x25_asy.c 2006-11-09 12:16:21.000000000 +0200 +++ linux-2.6.19-rc5_kzalloc/drivers/net/wan/x25_asy.c 2006-11-11 22:44:04.000000000 +0200 @@ -786,14 +786,13 @@ static int __init init_x25_asy(void) printk(KERN_INFO "X.25 async: version 0.00 ALPHA " "(dynamic channels, max=%d).\n", x25_asy_maxdev ); - x25_asy_devs = kmalloc(sizeof(struct net_device *)*x25_asy_maxdev, + x25_asy_devs = kzalloc(sizeof(struct net_device *)*x25_asy_maxdev, GFP_KERNEL); if (!x25_asy_devs) { printk(KERN_WARNING "X25 async: Can't allocate x25_asy_ctrls[] " "array! Uaargh! (-> No X.25 available)\n"); return -ENOMEM; } - memset(x25_asy_devs, 0, sizeof(struct net_device *)*x25_asy_maxdev); return tty_register_ldisc(N_X25, &x25_ldisc); }