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

stable inclusion
from stable-5.10.77
commit bfa6fbdb4e39b8483fd7ec70c4c82a5105348193
bugzilla: 185677 https://gitee.com/openeuler/kernel/issues/I4IAP7

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=bfa6fbdb4e39b8483fd7ec70c4c82a5105348193

--------------------------------

commit d6423d2 upstream.

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]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Chen Jun <[email protected]>
Acked-by: Weilong Chen <[email protected]>

Signed-off-by: Chen Jun <[email protected]>
Signed-off-by: Zheng Zengkai <[email protected]>
  • Loading branch information
microchip1 authored and Zhengzengkai committed Nov 15, 2021
1 parent 7a6256f commit 8125e16
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 @@ -3066,6 +3066,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 8125e16

Please sign in to comment.