lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210514082405.91011-1-pulehui@huawei.com>
Date:   Fri, 14 May 2021 16:24:05 +0800
From:   Pu Lehui <pulehui@...wei.com>
To:     <chris.snook@...il.com>, <davem@...emloft.net>, <kuba@...nel.org>,
        <johannes@...solutions.net>
CC:     <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <pulehui@...wei.com>
Subject: [PATCH net-next] 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")
Signed-off-by: Pu Lehui <pulehui@...wei.com>
---
 drivers/net/ethernet/atheros/alx/ethtool.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/atheros/alx/ethtool.c b/drivers/net/ethernet/atheros/alx/ethtool.c
index f3627157a38a..b716adacd815 100644
--- a/drivers/net/ethernet/atheros/alx/ethtool.c
+++ b/drivers/net/ethernet/atheros/alx/ethtool.c
@@ -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 */
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ