[PATCH net] net: ethernet: microchip: lan743x: Fix driver crash when lan743x_pm_resume fails

Subsystems: microchip lan743x ethernet driver, networking drivers, the rest

STALE1779d

2 messages, 2 authors, 2021-10-24 · open the first message on its own page

[PATCH net] net: ethernet: microchip: lan743x: Fix driver crash when lan743x_pm_resume fails

From: Yuiko Oshino <hidden>
Date: 2021-10-22 15:13:47

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")
Signed-off-by: Yuiko Oshino <redacted>
---
 drivers/net/ethernet/microchip/lan743x_main.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c
index 03d02403c19e..3f8cce7cce77 100644
--- a/drivers/net/ethernet/microchip/lan743x_main.c
+++ b/drivers/net/ethernet/microchip/lan743x_main.c
@@ -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.
-- 
2.25.1

Re: [PATCH net] net: ethernet: microchip: lan743x: Fix driver crash when lan743x_pm_resume fails

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-10-24 12:40:11

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller [off-list ref]:

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")
Signed-off-by: Yuiko Oshino <redacted>
---
 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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help