diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-11-21 19:15:06 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-11-28 01:53:38 -0500 |
commit | 89bf67f1f080c947c92f8773482d9e57767ca292 (patch) | |
tree | ae492f5f31a32a4f838778cd34320da0bedf9dfd /drivers/net/e1000 | |
parent | fe6d2a38b2076cba515dc95b5dc1589a7ab51c17 (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/e1000')
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 4686c3983fc3..dcb7f82c2701 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -1425,13 +1425,12 @@ static int e1000_setup_tx_resources(struct e1000_adapter *adapter, | |||
1425 | int size; | 1425 | int size; |
1426 | 1426 | ||
1427 | size = sizeof(struct e1000_buffer) * txdr->count; | 1427 | size = sizeof(struct e1000_buffer) * txdr->count; |
1428 | txdr->buffer_info = vmalloc(size); | 1428 | txdr->buffer_info = vzalloc(size); |
1429 | if (!txdr->buffer_info) { | 1429 | if (!txdr->buffer_info) { |
1430 | e_err(probe, "Unable to allocate memory for the Tx descriptor " | 1430 | e_err(probe, "Unable to allocate memory for the Tx descriptor " |
1431 | "ring\n"); | 1431 | "ring\n"); |
1432 | return -ENOMEM; | 1432 | return -ENOMEM; |
1433 | } | 1433 | } |
1434 | memset(txdr->buffer_info, 0, size); | ||
1435 | 1434 | ||
1436 | /* round up to nearest 4K */ | 1435 | /* round up to nearest 4K */ |
1437 | 1436 | ||
@@ -1621,13 +1620,12 @@ static int e1000_setup_rx_resources(struct e1000_adapter *adapter, | |||
1621 | int size, desc_len; | 1620 | int size, desc_len; |
1622 | 1621 | ||
1623 | size = sizeof(struct e1000_buffer) * rxdr->count; | 1622 | size = sizeof(struct e1000_buffer) * rxdr->count; |
1624 | rxdr->buffer_info = vmalloc(size); | 1623 | rxdr->buffer_info = vzalloc(size); |
1625 | if (!rxdr->buffer_info) { | 1624 | if (!rxdr->buffer_info) { |
1626 | e_err(probe, "Unable to allocate memory for the Rx descriptor " | 1625 | e_err(probe, "Unable to allocate memory for the Rx descriptor " |
1627 | "ring\n"); | 1626 | "ring\n"); |
1628 | return -ENOMEM; | 1627 | return -ENOMEM; |
1629 | } | 1628 | } |
1630 | memset(rxdr->buffer_info, 0, size); | ||
1631 | 1629 | ||
1632 | desc_len = sizeof(struct e1000_rx_desc); | 1630 | desc_len = sizeof(struct e1000_rx_desc); |
1633 | 1631 | ||