]> git.ipfire.org Git - thirdparty/linux.git/commit
ethtool: pse-pd: fix missing ethnl_ops_complete()
authorJakub Kicinski <kuba@kernel.org>
Tue, 26 May 2026 15:35:27 +0000 (08:35 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 28 May 2026 00:42:08 +0000 (17:42 -0700)
commitab5bf428fb6bd361163c7247b92750d1d24ca2ed
tree0e73343e3c16ab6b28e2223ca33a0d846283e07c
parent596c51ed9e125b12c4d85b4530dfd4c7847634b7
ethtool: pse-pd: fix missing ethnl_ops_complete()

pse_prepare_data() is missing ethnl_ops_complete() if
ethnl_req_get_phydev() returned an error. Move getting
phydev up so that we don't have to worry about this
(similar order to linkstate_prepare_data()).

Note that phydev may still be NULL (this is checked in
pse_get_pse_attributes()), the goal isn't really to avoid
the _begin() / _complete() calls, only to simplify the error
handling.

While at it propagate the original error. Why this code
overrides the error with -ENODEV but !phydev generates
-EOPNOTSUPP is unclear to me...

Fixes: 31748765bed3 ("net: ethtool: pse-pd: Target the command to the requested PHY")
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Link: https://patch.msgid.link/20260526153533.2779187-5-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ethtool/pse-pd.c