Skip to contentSkip to conversation

net: ethernet: microchip: lan743x: Fix driver crash when lan743x_pm_resume fails

PATCH Applied Yuiko Oshino 2 participants 2 messages Oct 22, 2021 – Oct 24, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: ethernet: microchip: lan743x: Fix driver crash when lan743x_pm_resume fails

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

Fixes 23f0703c125b ("lan743x: Add main source files for new lan743x driver")
---
 drivers/net/ethernet/microchip/lan743x_main.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/microchip/lan743x_main.c +2 -0
index 03d02403c19e..3f8cce7cce77 100644
@@ -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.
Signature · 1 line
2.25.1
#1 lore raw
This patch was applied to netdev/net.git (master) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <[email protected]>:

Quoted 7 lines · On Fri, 22 Oct 2021 11:13:53 -0400 you wrote:

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

Fixes 23f0703c125b ("lan743x: Add main source files for new lan743x driver")
---
 drivers/net/ethernet/microchip/lan743x_main.c | 2 ++
 1 file changed, 2 insertions(+)

Here is the summary with links:
- [net] net: ethernet: microchip: lan743x: Fix driver crash when lan743x_pm_resume fails

    https://git.kernel.org/netdev/net/c/d6423d2ec39c

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html