Skip to contentSkip to conversation

alx: fix missing unlock on error in alx_set_pauseparam()

PATCH Applied Pu Lehui 2 participants 2 messages May 14, 2021

Subsystems (3)
lore
Share & tools
lore

Pu Lehui

author
#0 lore raw

PATCH 1/1 alx: fix missing unlock on error in alx_set_pauseparam()

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

Fixes 4a5fe57e7751 ("alx: use fine-grained locking instead of RTNL")
---
 drivers/net/ethernet/atheros/alx/ethtool.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/atheros/alx/ethtool.c +3 -1
index f3627157a38a..b716adacd815 100644
@@ -253,8 +253,10 @@ static int alx_set_pauseparam(struct net_device *netdev,
 
 	if (reconfig_phy) {
 		err = alx_setup_speed_duplex(hw, hw->adv_cfg, fc);
-		if (err)
+		if (err) {
+			mutex_unlock(&alx->mtx);
 			return err;
+		}
 	}
 
 	/* flow control on mac */
Signature · 1 line
2.17.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 Fri, 14 May 2021 16:24:05 +0800 you wrote:

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

Fixes 4a5fe57e7751 ("alx: use fine-grained locking instead of RTNL")
---
 drivers/net/ethernet/atheros/alx/ethtool.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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

    https://git.kernel.org/netdev/net-next/c/2d1c5f29d27a

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