|
@@ -2128,27 +2128,25 @@ static int bcm_enetsw_open(struct net_device *dev)
|
|
|
|
|
|
/* allocate rx dma ring */
|
|
|
size = priv->rx_ring_size * sizeof(struct bcm_enet_desc);
|
|
|
- p = dma_alloc_coherent(kdev, size, &priv->rx_desc_dma, GFP_KERNEL);
|
|
|
+ p = dma_zalloc_coherent(kdev, size, &priv->rx_desc_dma, GFP_KERNEL);
|
|
|
if (!p) {
|
|
|
dev_err(kdev, "cannot allocate rx ring %u\n", size);
|
|
|
ret = -ENOMEM;
|
|
|
goto out_freeirq_tx;
|
|
|
}
|
|
|
|
|
|
- memset(p, 0, size);
|
|
|
priv->rx_desc_alloc_size = size;
|
|
|
priv->rx_desc_cpu = p;
|
|
|
|
|
|
/* allocate tx dma ring */
|
|
|
size = priv->tx_ring_size * sizeof(struct bcm_enet_desc);
|
|
|
- p = dma_alloc_coherent(kdev, size, &priv->tx_desc_dma, GFP_KERNEL);
|
|
|
+ p = dma_zalloc_coherent(kdev, size, &priv->tx_desc_dma, GFP_KERNEL);
|
|
|
if (!p) {
|
|
|
dev_err(kdev, "cannot allocate tx ring\n");
|
|
|
ret = -ENOMEM;
|
|
|
goto out_free_rx_ring;
|
|
|
}
|
|
|
|
|
|
- memset(p, 0, size);
|
|
|
priv->tx_desc_alloc_size = size;
|
|
|
priv->tx_desc_cpu = p;
|
|
|
|