summaryrefslogtreecommitdiffstats
path: root/net/ethtool
diff options
context:
space:
mode:
authorKory Maincent <kory.maincent@bootlin.com>2024-07-11 15:55:18 +0200
committerJakub Kicinski <kuba@kernel.org>2024-07-14 07:16:18 -0700
commit93c3a96c301f0b1ac0bafb5e74bef58e79937648 (patch)
tree56fae80c7272923fbd9eace6f2aad3d26af6a3a9 /net/ethtool
parent70c676cb3dfcc75e32eaf0e98eba6814ebfc6af6 (diff)
downloadlinux-stable-93c3a96c301f0b1ac0bafb5e74bef58e79937648.tar.gz
linux-stable-93c3a96c301f0b1ac0bafb5e74bef58e79937648.tar.bz2
linux-stable-93c3a96c301f0b1ac0bafb5e74bef58e79937648.zip
net: pse-pd: Do not return EOPNOSUPP if config is null
For a PSE supporting both c33 and PoDL, setting config for one type of PoE leaves the other type's config null. Currently, this case returns EOPNOTSUPP, which is incorrect. Instead, we should do nothing if the configuration is empty. Signed-off-by: Kory Maincent <kory.maincent@bootlin.com> Fixes: d83e13761d5b ("net: pse-pd: Use regulator framework within PSE framework") Link: https://patch.msgid.link/20240711-fix_pse_pd_deref-v3-1-edd78fc4fe42@bootlin.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ethtool')
-rw-r--r--net/ethtool/pse-pd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ethtool/pse-pd.c b/net/ethtool/pse-pd.c
index 2c981d443f27..982995ff1628 100644
--- a/net/ethtool/pse-pd.c
+++ b/net/ethtool/pse-pd.c
@@ -183,7 +183,9 @@ ethnl_set_pse(struct ethnl_req_info *req_info, struct genl_info *info)
if (pse_has_c33(phydev->psec))
config.c33_admin_control = nla_get_u32(tb[ETHTOOL_A_C33_PSE_ADMIN_CONTROL]);
- /* Return errno directly - PSE has no notification */
+ /* Return errno directly - PSE has no notification
+ * pse_ethtool_set_config() will do nothing if the config is null
+ */
return pse_ethtool_set_config(phydev->psec, info->extack, &config);
}