|
@@ -1189,41 +1189,41 @@ static int alloc_dma_desc_resources(struct stmmac_priv *priv)
|
|
|
goto err_tx_skbuff;
|
|
|
|
|
|
if (priv->extend_desc) {
|
|
|
- priv->dma_erx = dma_alloc_coherent(priv->device, rxsize *
|
|
|
- sizeof(struct
|
|
|
- dma_extended_desc),
|
|
|
- &priv->dma_rx_phy,
|
|
|
- GFP_KERNEL);
|
|
|
+ priv->dma_erx = dma_zalloc_coherent(priv->device, rxsize *
|
|
|
+ sizeof(struct
|
|
|
+ dma_extended_desc),
|
|
|
+ &priv->dma_rx_phy,
|
|
|
+ GFP_KERNEL);
|
|
|
if (!priv->dma_erx)
|
|
|
goto err_dma;
|
|
|
|
|
|
- priv->dma_etx = dma_alloc_coherent(priv->device, txsize *
|
|
|
- sizeof(struct
|
|
|
- dma_extended_desc),
|
|
|
- &priv->dma_tx_phy,
|
|
|
- GFP_KERNEL);
|
|
|
+ priv->dma_etx = dma_zalloc_coherent(priv->device, txsize *
|
|
|
+ sizeof(struct
|
|
|
+ dma_extended_desc),
|
|
|
+ &priv->dma_tx_phy,
|
|
|
+ GFP_KERNEL);
|
|
|
if (!priv->dma_etx) {
|
|
|
dma_free_coherent(priv->device, priv->dma_rx_size *
|
|
|
- sizeof(struct dma_extended_desc),
|
|
|
- priv->dma_erx, priv->dma_rx_phy);
|
|
|
+ sizeof(struct dma_extended_desc),
|
|
|
+ priv->dma_erx, priv->dma_rx_phy);
|
|
|
goto err_dma;
|
|
|
}
|
|
|
} else {
|
|
|
- priv->dma_rx = dma_alloc_coherent(priv->device, rxsize *
|
|
|
- sizeof(struct dma_desc),
|
|
|
- &priv->dma_rx_phy,
|
|
|
- GFP_KERNEL);
|
|
|
+ priv->dma_rx = dma_zalloc_coherent(priv->device, rxsize *
|
|
|
+ sizeof(struct dma_desc),
|
|
|
+ &priv->dma_rx_phy,
|
|
|
+ GFP_KERNEL);
|
|
|
if (!priv->dma_rx)
|
|
|
goto err_dma;
|
|
|
|
|
|
- priv->dma_tx = dma_alloc_coherent(priv->device, txsize *
|
|
|
- sizeof(struct dma_desc),
|
|
|
- &priv->dma_tx_phy,
|
|
|
- GFP_KERNEL);
|
|
|
+ priv->dma_tx = dma_zalloc_coherent(priv->device, txsize *
|
|
|
+ sizeof(struct dma_desc),
|
|
|
+ &priv->dma_tx_phy,
|
|
|
+ GFP_KERNEL);
|
|
|
if (!priv->dma_tx) {
|
|
|
dma_free_coherent(priv->device, priv->dma_rx_size *
|
|
|
- sizeof(struct dma_desc),
|
|
|
- priv->dma_rx, priv->dma_rx_phy);
|
|
|
+ sizeof(struct dma_desc),
|
|
|
+ priv->dma_rx, priv->dma_rx_phy);
|
|
|
goto err_dma;
|
|
|
}
|
|
|
}
|