Skip to content

Commit

Permalink
drivers/net/tokenring/3c359.c
Browse files Browse the repository at this point in the history
Hi,
   Replacing kmalloc with kzalloc and cleaning up memset in
drivers/net/tokenring/3c359.c

Signed-off-by: Surya Prabhakar <surya.prabhakar@wipro.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Surya Prabhakar N authored and David S. Miller committed Oct 10, 2007
1 parent b1c9e0f commit c821d55
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/net/tokenring/3c359.c
Original file line number Diff line number Diff line change
Expand Up @@ -641,23 +641,21 @@ static int xl_open(struct net_device *dev)
* Now to set up the Rx and Tx buffer structures
*/
/* These MUST be on 8 byte boundaries */
xl_priv->xl_tx_ring = kmalloc((sizeof(struct xl_tx_desc) * XL_TX_RING_SIZE) + 7, GFP_DMA | GFP_KERNEL) ;
xl_priv->xl_tx_ring = kzalloc((sizeof(struct xl_tx_desc) * XL_TX_RING_SIZE) + 7, GFP_DMA | GFP_KERNEL);
if (xl_priv->xl_tx_ring == NULL) {
printk(KERN_WARNING "%s: Not enough memory to allocate rx buffers.\n",
dev->name);
free_irq(dev->irq,dev);
return -ENOMEM;
}
xl_priv->xl_rx_ring = kmalloc((sizeof(struct xl_rx_desc) * XL_RX_RING_SIZE) +7, GFP_DMA | GFP_KERNEL) ;
xl_priv->xl_rx_ring = kzalloc((sizeof(struct xl_rx_desc) * XL_RX_RING_SIZE) +7, GFP_DMA | GFP_KERNEL);
if (xl_priv->xl_tx_ring == NULL) {
printk(KERN_WARNING "%s: Not enough memory to allocate rx buffers.\n",
dev->name);
free_irq(dev->irq,dev);
kfree(xl_priv->xl_tx_ring);
return -ENOMEM;
}
memset(xl_priv->xl_tx_ring,0,sizeof(struct xl_tx_desc) * XL_TX_RING_SIZE) ;
memset(xl_priv->xl_rx_ring,0,sizeof(struct xl_rx_desc) * XL_RX_RING_SIZE) ;

/* Setup Rx Ring */
for (i=0 ; i < XL_RX_RING_SIZE ; i++) {
Expand Down

0 comments on commit c821d55

Please sign in to comment.