@@ -1295,6 +1295,8 @@ static int init_dma_rx_desc_rings(struct net_device *dev, gfp_t flags)
1295
1295
"(%s) dma_rx_phy=0x%08x\n" , __func__ ,
1296
1296
(u32 )rx_q -> dma_rx_phy );
1297
1297
1298
+ stmmac_clear_rx_descriptors (priv , queue );
1299
+
1298
1300
for (i = 0 ; i < DMA_RX_SIZE ; i ++ ) {
1299
1301
struct dma_desc * p ;
1300
1302
@@ -1312,8 +1314,6 @@ static int init_dma_rx_desc_rings(struct net_device *dev, gfp_t flags)
1312
1314
rx_q -> cur_rx = 0 ;
1313
1315
rx_q -> dirty_rx = (unsigned int )(i - DMA_RX_SIZE );
1314
1316
1315
- stmmac_clear_rx_descriptors (priv , queue );
1316
-
1317
1317
/* Setup the chained descriptor addresses */
1318
1318
if (priv -> mode == STMMAC_CHAIN_MODE ) {
1319
1319
if (priv -> extend_desc )
@@ -1555,9 +1555,8 @@ static int alloc_dma_rx_desc_resources(struct stmmac_priv *priv)
1555
1555
goto err_dma ;
1556
1556
}
1557
1557
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 );
1561
1560
if (!rx_q -> buf_pool )
1562
1561
goto err_dma ;
1563
1562
@@ -1608,15 +1607,15 @@ static int alloc_dma_tx_desc_resources(struct stmmac_priv *priv)
1608
1607
tx_q -> queue_index = queue ;
1609
1608
tx_q -> priv_data = priv ;
1610
1609
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 );
1614
1613
if (!tx_q -> tx_skbuff_dma )
1615
1614
goto err_dma ;
1616
1615
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 );
1620
1619
if (!tx_q -> tx_skbuff )
1621
1620
goto err_dma ;
1622
1621
0 commit comments