* [PATCH 1/2 net-next] alx: fix a double unlock in alx_probe()
@ 2021-05-17 8:57 Dan Carpenter
2021-05-17 8:58 ` [PATCH 2/2 net-next] alx: unlock on error in alx_set_pauseparam() Dan Carpenter
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2021-05-17 8:57 UTC (permalink / raw)
To: Chris Snook, Johannes Berg
Cc: Zekun Shen, netdev, kernel-janitors, David S. Miller, Jakub Kicinski
We're not holding the lock at this point so "goto unlock;" should be
"goto unmap;"
Fixes: 4a5fe57e7751 ("alx: use fine-grained locking instead of RTNL")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/net/ethernet/atheros/alx/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/atheros/alx/main.c b/drivers/net/ethernet/atheros/alx/main.c
index e8884879a50f..45e380f3b065 100644
--- a/drivers/net/ethernet/atheros/alx/main.c
+++ b/drivers/net/ethernet/atheros/alx/main.c
@@ -1859,7 +1859,7 @@ static int alx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
err = register_netdev(netdev);
if (err) {
dev_err(&pdev->dev, "register netdevice failed\n");
- goto out_unlock;
+ goto out_unmap;
}
netdev_info(netdev,
--
2.30.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2 net-next] alx: unlock on error in alx_set_pauseparam()
2021-05-17 8:57 [PATCH 1/2 net-next] alx: fix a double unlock in alx_probe() Dan Carpenter
@ 2021-05-17 8:58 ` Dan Carpenter
2021-05-17 9:12 ` Johannes Berg
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2021-05-17 8:58 UTC (permalink / raw)
To: Chris Snook
Cc: David S. Miller, Jakub Kicinski, Johannes Berg, netdev, kernel-janitors
We need to drop the lock before returning on this error path.
Fixes: 4a5fe57e7751 ("alx: use fine-grained locking instead of RTNL")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.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.30.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 2/2 net-next] alx: unlock on error in alx_set_pauseparam()
2021-05-17 8:58 ` [PATCH 2/2 net-next] alx: unlock on error in alx_set_pauseparam() Dan Carpenter
@ 2021-05-17 9:12 ` Johannes Berg
0 siblings, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2021-05-17 9:12 UTC (permalink / raw)
To: Dan Carpenter, Chris Snook
Cc: David S. Miller, Jakub Kicinski, netdev, kernel-janitors
On Mon, 2021-05-17 at 11:58 +0300, Dan Carpenter wrote:
> We need to drop the lock before returning on this error path.
Haha, how many locking errors can I have in a single patch :(
Sorry, and thanks for all the fixes!
johannes
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-05-17 9:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-17 8:57 [PATCH 1/2 net-next] alx: fix a double unlock in alx_probe() Dan Carpenter
2021-05-17 8:58 ` [PATCH 2/2 net-next] alx: unlock on error in alx_set_pauseparam() Dan Carpenter
2021-05-17 9:12 ` Johannes Berg
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.