aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgb
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-11-21 19:15:06 -0500
committerDavid S. Miller <davem@davemloft.net>2010-11-28 01:53:38 -0500
commit89bf67f1f080c947c92f8773482d9e57767ca292 (patch)
treeae492f5f31a32a4f838778cd34320da0bedf9dfd /drivers/net/ixgb
parentfe6d2a38b2076cba515dc95b5dc1589a7ab51c17 (diff)
drivers/net: use vzalloc()
Use vzalloc() and vzalloc_node() in net drivers Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Acked-by: Jon Mason <jon.mason@exar.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ixgb')
-rw-r--r--drivers/net/ixgb/ixgb_main.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index caa8192fff2a..211a1694667e 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -669,13 +669,12 @@ ixgb_setup_tx_resources(struct ixgb_adapter *adapter)
669 int size; 669 int size;
670 670
671 size = sizeof(struct ixgb_buffer) * txdr->count; 671 size = sizeof(struct ixgb_buffer) * txdr->count;
672 txdr->buffer_info = vmalloc(size); 672 txdr->buffer_info = vzalloc(size);
673 if (!txdr->buffer_info) { 673 if (!txdr->buffer_info) {
674 netif_err(adapter, probe, adapter->netdev, 674 netif_err(adapter, probe, adapter->netdev,
675 "Unable to allocate transmit descriptor ring memory\n"); 675 "Unable to allocate transmit descriptor ring memory\n");
676 return -ENOMEM; 676 return -ENOMEM;
677 } 677 }
678 memset(txdr->buffer_info, 0, size);
679 678
680 /* round up to nearest 4K */ 679 /* round up to nearest 4K */
681 680
@@ -759,13 +758,12 @@ ixgb_setup_rx_resources(struct ixgb_adapter *adapter)
759 int size; 758 int size;
760 759
761 size = sizeof(struct ixgb_buffer) * rxdr->count; 760 size = sizeof(struct ixgb_buffer) * rxdr->count;
762 rxdr->buffer_info = vmalloc(size); 761 rxdr->buffer_info = vzalloc(size);
763 if (!rxdr->buffer_info) { 762 if (!rxdr->buffer_info) {
764 netif_err(adapter, probe, adapter->netdev, 763 netif_err(adapter, probe, adapter->netdev,
765 "Unable to allocate receive descriptor ring\n"); 764 "Unable to allocate receive descriptor ring\n");
766 return -ENOMEM; 765 return -ENOMEM;
767 } 766 }
768 memset(rxdr->buffer_info, 0, size);
769 767
770 /* Round up to nearest 4K */ 768 /* Round up to nearest 4K */
771 769