Skip to content

Commit 596c51e

Browse files
committed
ethtool: linkstate: fix unbalanced ethnl_ops_complete() on PHY lookup error
linkstate_prepare_data() calls ethnl_req_get_phydev() before ethnl_ops_begin(), but routes its error path through "goto out" which calls ethnl_ops_complete(). Fixes: fe55b1d ("ethtool: linkstate: migrate linkstate functions to support multi-PHY setups") Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Link: https://patch.msgid.link/20260526153533.2779187-4-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent a888bbd commit 596c51e

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

net/ethtool/linkstate.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,8 @@ static int linkstate_prepare_data(const struct ethnl_req_info *req_base,
106106

107107
phydev = ethnl_req_get_phydev(req_base, tb, ETHTOOL_A_LINKSTATE_HEADER,
108108
info->extack);
109-
if (IS_ERR(phydev)) {
110-
ret = PTR_ERR(phydev);
111-
goto out;
112-
}
109+
if (IS_ERR(phydev))
110+
return PTR_ERR(phydev);
113111

114112
ret = ethnl_ops_begin(dev);
115113
if (ret < 0)

0 commit comments

Comments
 (0)