Skip to content

Commit 4fd6dc9

Browse files
Doug Bergerdavem330
authored andcommitted
net: bcmgenet: prevent duplicate calls of bcmgenet_dma_teardown
When bcmgenet_dma_teardown is called from bcmgenet_fini_dma it ends up getting called twice from the bcmgenet_close and bcmgenet_suspend functions (once directly and once inside the bcmgenet_fini_dma call). This commit removes the call from bcmgenet_fini_dma and ensures that bcmgenet_dma_teardown is called before bcmgenet_fini_dma in all paths of execution. Fixes: 4a0c081 ("net: bcmgenet: call bcmgenet_dma_teardown in bcmgenet_fini_dma") Signed-off-by: Doug Berger <opendmb@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 0d31450 commit 4fd6dc9

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/net/ethernet/broadcom/genet/bcmgenet.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2505,9 +2505,6 @@ static void bcmgenet_fini_dma(struct bcmgenet_priv *priv)
25052505
bcmgenet_fini_rx_napi(priv);
25062506
bcmgenet_fini_tx_napi(priv);
25072507

2508-
/* disable DMA */
2509-
bcmgenet_dma_teardown(priv);
2510-
25112508
for (i = 0; i < priv->num_tx_bds; i++) {
25122509
cb = priv->tx_cbs + i;
25132510
skb = bcmgenet_free_tx_cb(&priv->pdev->dev, cb);
@@ -2930,6 +2927,7 @@ static int bcmgenet_open(struct net_device *dev)
29302927
err_irq0:
29312928
free_irq(priv->irq0, priv);
29322929
err_fini_dma:
2930+
bcmgenet_dma_teardown(priv);
29332931
bcmgenet_fini_dma(priv);
29342932
err_clk_disable:
29352933
if (priv->internal_phy)

0 commit comments

Comments
 (0)