Skip to content

Commit 01ad7fa

Browse files
committed
Merge branch 'stmmac-fixes'
Jose Abreu says: ==================== net: stmmac: Two fixes Two fixes targeting -net. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents f4e5f77 + ec5e5ce commit 01ad7fa

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,6 +1295,8 @@ static int init_dma_rx_desc_rings(struct net_device *dev, gfp_t flags)
12951295
"(%s) dma_rx_phy=0x%08x\n", __func__,
12961296
(u32)rx_q->dma_rx_phy);
12971297

1298+
stmmac_clear_rx_descriptors(priv, queue);
1299+
12981300
for (i = 0; i < DMA_RX_SIZE; i++) {
12991301
struct dma_desc *p;
13001302

@@ -1312,8 +1314,6 @@ static int init_dma_rx_desc_rings(struct net_device *dev, gfp_t flags)
13121314
rx_q->cur_rx = 0;
13131315
rx_q->dirty_rx = (unsigned int)(i - DMA_RX_SIZE);
13141316

1315-
stmmac_clear_rx_descriptors(priv, queue);
1316-
13171317
/* Setup the chained descriptor addresses */
13181318
if (priv->mode == STMMAC_CHAIN_MODE) {
13191319
if (priv->extend_desc)
@@ -1555,9 +1555,8 @@ static int alloc_dma_rx_desc_resources(struct stmmac_priv *priv)
15551555
goto err_dma;
15561556
}
15571557

1558-
rx_q->buf_pool = kmalloc_array(DMA_RX_SIZE,
1559-
sizeof(*rx_q->buf_pool),
1560-
GFP_KERNEL);
1558+
rx_q->buf_pool = kcalloc(DMA_RX_SIZE, sizeof(*rx_q->buf_pool),
1559+
GFP_KERNEL);
15611560
if (!rx_q->buf_pool)
15621561
goto err_dma;
15631562

@@ -1608,15 +1607,15 @@ static int alloc_dma_tx_desc_resources(struct stmmac_priv *priv)
16081607
tx_q->queue_index = queue;
16091608
tx_q->priv_data = priv;
16101609

1611-
tx_q->tx_skbuff_dma = kmalloc_array(DMA_TX_SIZE,
1612-
sizeof(*tx_q->tx_skbuff_dma),
1613-
GFP_KERNEL);
1610+
tx_q->tx_skbuff_dma = kcalloc(DMA_TX_SIZE,
1611+
sizeof(*tx_q->tx_skbuff_dma),
1612+
GFP_KERNEL);
16141613
if (!tx_q->tx_skbuff_dma)
16151614
goto err_dma;
16161615

1617-
tx_q->tx_skbuff = kmalloc_array(DMA_TX_SIZE,
1618-
sizeof(struct sk_buff *),
1619-
GFP_KERNEL);
1616+
tx_q->tx_skbuff = kcalloc(DMA_TX_SIZE,
1617+
sizeof(struct sk_buff *),
1618+
GFP_KERNEL);
16201619
if (!tx_q->tx_skbuff)
16211620
goto err_dma;
16221621

0 commit comments

Comments
 (0)