# \[patch net-next v2\] net: fix unreleased lock in cable test

- From: Diogo Jahchan Koike \<hidden\>
- Date: 2024-08-26 13:47:26 
- List: netdev
- Page: https://ratatoskr.run/netdev/2024/08/2722065
- Thread: https://ratatoskr.run/netdev/2024/08/2722065/t.md

```text
fix an unreleased lock in out_dev_put path by removing the (now)
unnecessary path.

Reported-by: <redacted>
Closes: https://syzkaller.appspot.com/bug?extid=c641161e97237326ea74
Fixes: 3688ff3077d3 ("net: ethtool: cable-test: Target the command to the requested PHY")
Signed-off-by: Diogo Jahchan Koike <redacted>
---
 net/ethtool/cabletest.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/ethtool/cabletest.c b/net/ethtool/cabletest.c
index 01db8f394869..8c5aa63cb1aa 100644
--- a/net/ethtool/cabletest.c
+++ b/net/ethtool/cabletest.c
@@ -77,7 +77,7 @@ int ethnl_act_cable_test(struct sk_buff *skb, struct genl_info *info)
 				      info->extack);
 	if (IS_ERR_OR_NULL(phydev)) {
 		ret = -EOPNOTSUPP;
-		goto out_dev_put;
+		goto out_rtnl;
 	}
 
 	ops = ethtool_phy_ops;
@@ -99,7 +99,6 @@ int ethnl_act_cable_test(struct sk_buff *skb, struct genl_info *info)
 
 out_rtnl:
 	rtnl_unlock();
-out_dev_put:
 	ethnl_parse_header_dev_put(&req_info);
 	return ret;
 }
-- 
2.43.0

```
