Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[firefly-linux-kernel-4.4.55.git] / drivers / net / ethernet / broadcom / bcm63xx_enet.c
index 79cf620ab44992f8ae8544992967af7386d02d81..0b3e23ec37f769dde56f47f475b262c5c101f35d 100644 (file)
@@ -862,25 +862,25 @@ static int bcm_enet_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_alloc_coherent(kdev, size, &priv->rx_desc_dma,
+                              GFP_KERNEL | __GFP_ZERO);
        if (!p) {
                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_alloc_coherent(kdev, size, &priv->tx_desc_dma,
+                              GFP_KERNEL | __GFP_ZERO);
        if (!p) {
                ret = -ENOMEM;
                goto out_free_rx_ring;
        }
 
-       memset(p, 0, size);
        priv->tx_desc_alloc_size = size;
        priv->tx_desc_cpu = p;