Skip to contentSkip to conversation

net: stmmac: fix missing unlock on error in stmmac_suspend()

PATCH Applied Yang Yingliang 2 participants 2 messages Mar 27, 2021 – Mar 29, 2021

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

PATCH 1/1 net: stmmac: fix missing unlock on error in stmmac_suspend()

Add the missing unlock before return from stmmac_suspend() in the error handling case.

Fixes 5ec55823438e ("net: stmmac: add clocks management for gmac driver")
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +3 -1
index 170296820af0..973bdf11e59d 100644
@@ -5605,8 +5605,10 @@ int stmmac_suspend(struct device *dev)
 		/* Disable clock in case of PWM is off */
 		clk_disable_unprepare(priv->plat->clk_ptp_ref);
 		ret = pm_runtime_force_suspend(dev);
-		if (ret)
+		if (ret) {
+			mutex_unlock(&priv->lock);
 			return ret;
+		}
 	}
 
 	mutex_unlock(&priv->lock);
Signature · 1 line
2.25.1
#1 lore raw
This patch was applied to netdev/net-next.git (refs/heads/master):

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

Quoted 8 lines · On Sat, 27 Mar 2021 17:33:22 +0800 you wrote:

Add the missing unlock before return from stmmac_suspend() in the error handling case.

Fixes 5ec55823438e ("net: stmmac: add clocks management for gmac driver")

[...]

Here is the summary with links:
- [-next] net: stmmac: fix missing unlock on error in stmmac_suspend()

    https://git.kernel.org/netdev/net-next/c/30f347ae7cc1

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html