Skip to content

Commit faa6208

Browse files
claudiubezneadavem330
authored andcommitted
net: macb: undo operations in case of failure
Undo previously done operation in case macb_phylink_connect() fails. Since macb_reset_hw() is the 1st undo operation the napi_exit label was renamed to reset_hw. Fixes: 7897b07 ("net: macb: convert to phylink") Signed-off-by: Claudiu Beznea <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2996cbd commit faa6208

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/net/ethernet/cadence/macb_main.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2558,7 +2558,7 @@ static int macb_open(struct net_device *dev)
25582558

25592559
err = macb_phylink_connect(bp);
25602560
if (err)
2561-
goto napi_exit;
2561+
goto reset_hw;
25622562

25632563
netif_tx_start_all_queues(dev);
25642564

@@ -2567,9 +2567,11 @@ static int macb_open(struct net_device *dev)
25672567

25682568
return 0;
25692569

2570-
napi_exit:
2570+
reset_hw:
2571+
macb_reset_hw(bp);
25712572
for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue)
25722573
napi_disable(&queue->napi);
2574+
macb_free_consistent(bp);
25732575
pm_exit:
25742576
pm_runtime_put_sync(&bp->pdev->dev);
25752577
return err;

0 commit comments

Comments
 (0)