diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-11-22 01:15:06 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-11-28 07:53:38 +0100 |
commit | 89bf67f1f080c947c92f8773482d9e57767ca292 (patch) | |
tree | ae492f5f31a32a4f838778cd34320da0bedf9dfd /drivers/net/bnx2.c | |
parent | be2net: adding support for Lancer family of CNAs (diff) | |
download | linux-89bf67f1f080c947c92f8773482d9e57767ca292.tar.xz linux-89bf67f1f080c947c92f8773482d9e57767ca292.zip |
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/bnx2.c')
-rw-r--r-- | drivers/net/bnx2.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 062600be073b..0de196da4d4a 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c @@ -766,13 +766,10 @@ bnx2_alloc_rx_mem(struct bnx2 *bp) int j; rxr->rx_buf_ring = - vmalloc(SW_RXBD_RING_SIZE * bp->rx_max_ring); + vzalloc(SW_RXBD_RING_SIZE * bp->rx_max_ring); if (rxr->rx_buf_ring == NULL) return -ENOMEM; - memset(rxr->rx_buf_ring, 0, - SW_RXBD_RING_SIZE * bp->rx_max_ring); - for (j = 0; j < bp->rx_max_ring; j++) { rxr->rx_desc_ring[j] = dma_alloc_coherent(&bp->pdev->dev, @@ -785,13 +782,11 @@ bnx2_alloc_rx_mem(struct bnx2 *bp) } if (bp->rx_pg_ring_size) { - rxr->rx_pg_ring = vmalloc(SW_RXPG_RING_SIZE * + rxr->rx_pg_ring = vzalloc(SW_RXPG_RING_SIZE * bp->rx_max_pg_ring); if (rxr->rx_pg_ring == NULL) return -ENOMEM; - memset(rxr->rx_pg_ring, 0, SW_RXPG_RING_SIZE * - bp->rx_max_pg_ring); } for (j = 0; j < bp->rx_max_pg_ring; j++) { |