diff options
Diffstat (limited to 'drivers/net/pch_gbe')
-rw-r--r-- | drivers/net/pch_gbe/pch_gbe_main.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/pch_gbe/pch_gbe_main.c b/drivers/net/pch_gbe/pch_gbe_main.c index 472056b47440..afb75066b14d 100644 --- a/drivers/net/pch_gbe/pch_gbe_main.c +++ b/drivers/net/pch_gbe/pch_gbe_main.c | |||
@@ -1523,12 +1523,11 @@ int pch_gbe_setup_tx_resources(struct pch_gbe_adapter *adapter, | |||
1523 | int desNo; | 1523 | int desNo; |
1524 | 1524 | ||
1525 | size = (int)sizeof(struct pch_gbe_buffer) * tx_ring->count; | 1525 | size = (int)sizeof(struct pch_gbe_buffer) * tx_ring->count; |
1526 | tx_ring->buffer_info = vmalloc(size); | 1526 | tx_ring->buffer_info = vzalloc(size); |
1527 | if (!tx_ring->buffer_info) { | 1527 | if (!tx_ring->buffer_info) { |
1528 | pr_err("Unable to allocate memory for the buffer infomation\n"); | 1528 | pr_err("Unable to allocate memory for the buffer infomation\n"); |
1529 | return -ENOMEM; | 1529 | return -ENOMEM; |
1530 | } | 1530 | } |
1531 | memset(tx_ring->buffer_info, 0, size); | ||
1532 | 1531 | ||
1533 | tx_ring->size = tx_ring->count * (int)sizeof(struct pch_gbe_tx_desc); | 1532 | tx_ring->size = tx_ring->count * (int)sizeof(struct pch_gbe_tx_desc); |
1534 | 1533 | ||
@@ -1573,12 +1572,11 @@ int pch_gbe_setup_rx_resources(struct pch_gbe_adapter *adapter, | |||
1573 | int desNo; | 1572 | int desNo; |
1574 | 1573 | ||
1575 | size = (int)sizeof(struct pch_gbe_buffer) * rx_ring->count; | 1574 | size = (int)sizeof(struct pch_gbe_buffer) * rx_ring->count; |
1576 | rx_ring->buffer_info = vmalloc(size); | 1575 | rx_ring->buffer_info = vzalloc(size); |
1577 | if (!rx_ring->buffer_info) { | 1576 | if (!rx_ring->buffer_info) { |
1578 | pr_err("Unable to allocate memory for the receive descriptor ring\n"); | 1577 | pr_err("Unable to allocate memory for the receive descriptor ring\n"); |
1579 | return -ENOMEM; | 1578 | return -ENOMEM; |
1580 | } | 1579 | } |
1581 | memset(rx_ring->buffer_info, 0, size); | ||
1582 | rx_ring->size = rx_ring->count * (int)sizeof(struct pch_gbe_rx_desc); | 1580 | rx_ring->size = rx_ring->count * (int)sizeof(struct pch_gbe_rx_desc); |
1583 | rx_ring->desc = dma_alloc_coherent(&pdev->dev, rx_ring->size, | 1581 | rx_ring->desc = dma_alloc_coherent(&pdev->dev, rx_ring->size, |
1584 | &rx_ring->dma, GFP_KERNEL); | 1582 | &rx_ring->dma, GFP_KERNEL); |