Skip to content

Commit

Permalink
net: ethernet: microchip: lan743x: Fix driver crash when lan743x_pm_r…
Browse files Browse the repository at this point in the history
…esume fails

The driver needs to clean up and return when the initialization fails on resume.

Fixes: 23f0703 ("lan743x: Add main source files for new lan743x driver")
Signed-off-by: Yuiko Oshino <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
microchip1 authored and davem330 committed Oct 24, 2021
1 parent 1f83b83 commit d6423d2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/ethernet/microchip/lan743x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3019,6 +3019,8 @@ static int lan743x_pm_resume(struct device *dev)
if (ret) {
netif_err(adapter, probe, adapter->netdev,
"lan743x_hardware_init returned %d\n", ret);
lan743x_pci_cleanup(adapter);
return ret;
}

/* open netdev when netdev is at running state while resume.
Expand Down

0 comments on commit d6423d2

Please sign in to comment.