aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/qlcnic/qlcnic_init.c
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/qlcnic/qlcnic_init.c
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/qlcnic/qlcnic_init.c')
-rw-r--r--drivers/net/qlcnic/qlcnic_init.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/qlcnic/qlcnic_init.c b/drivers/net/qlcnic/qlcnic_init.c
index 0d180c6e41fe..3f970187cfce 100644
--- a/drivers/net/qlcnic/qlcnic_init.c
+++ b/drivers/net/qlcnic/qlcnic_init.c
@@ -236,12 +236,11 @@ int qlcnic_alloc_sw_resources(struct qlcnic_adapter *adapter)
236 tx_ring->num_desc = adapter->num_txd; 236 tx_ring->num_desc = adapter->num_txd;
237 tx_ring->txq = netdev_get_tx_queue(netdev, 0); 237 tx_ring->txq = netdev_get_tx_queue(netdev, 0);
238 238
239 cmd_buf_arr = vmalloc(TX_BUFF_RINGSIZE(tx_ring)); 239 cmd_buf_arr = vzalloc(TX_BUFF_RINGSIZE(tx_ring));
240 if (cmd_buf_arr == NULL) { 240 if (cmd_buf_arr == NULL) {
241 dev_err(&netdev->dev, "failed to allocate cmd buffer ring\n"); 241 dev_err(&netdev->dev, "failed to allocate cmd buffer ring\n");
242 goto err_out; 242 goto err_out;
243 } 243 }
244 memset(cmd_buf_arr, 0, TX_BUFF_RINGSIZE(tx_ring));
245 tx_ring->cmd_buf_arr = cmd_buf_arr; 244 tx_ring->cmd_buf_arr = cmd_buf_arr;
246 245
247 recv_ctx = &adapter->recv_ctx; 246 recv_ctx = &adapter->recv_ctx;
@@ -276,13 +275,12 @@ int qlcnic_alloc_sw_resources(struct qlcnic_adapter *adapter)
276 break; 275 break;
277 } 276 }
278 rds_ring->rx_buf_arr = (struct qlcnic_rx_buffer *) 277 rds_ring->rx_buf_arr = (struct qlcnic_rx_buffer *)
279 vmalloc(RCV_BUFF_RINGSIZE(rds_ring)); 278 vzalloc(RCV_BUFF_RINGSIZE(rds_ring));
280 if (rds_ring->rx_buf_arr == NULL) { 279 if (rds_ring->rx_buf_arr == NULL) {
281 dev_err(&netdev->dev, "Failed to allocate " 280 dev_err(&netdev->dev, "Failed to allocate "
282 "rx buffer ring %d\n", ring); 281 "rx buffer ring %d\n", ring);
283 goto err_out; 282 goto err_out;
284 } 283 }
285 memset(rds_ring->rx_buf_arr, 0, RCV_BUFF_RINGSIZE(rds_ring));
286 INIT_LIST_HEAD(&rds_ring->free_list); 284 INIT_LIST_HEAD(&rds_ring->free_list);
287 /* 285 /*
288 * Now go through all of them, set reference handles 286 * Now go through all of them, set reference handles