From: Diogo Jahchan Koike Date: Mon, 26 Aug 2024 13:45:46 +0000 (-0300) Subject: net: fix unreleased lock in cable test X-Git-Tag: v6.12-rc1~232^2~173 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=3d6a0c4f4552c8b08ba63b9da97c8255db4c6a56;p=linux-block.git net: fix unreleased lock in cable test fix an unreleased lock in out_dev_put path by removing the (now) unnecessary path. Reported-by: syzbot+c641161e97237326ea74@syzkaller.appspotmail.com 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 Reviewed-by: Maxime Chevallier Link: https://patch.msgid.link/20240826134656.94892-1-djahchankoike@gmail.com Signed-off-by: Jakub Kicinski --- diff --git a/net/ethtool/cabletest.c b/net/ethtool/cabletest.c index ff2fe3566ace..3a91b65c1f9a 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; }