summaryrefslogtreecommitdiffstats
path: root/net/ethtool
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2023-11-26 14:58:06 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-01-10 17:10:32 +0100
commit5ff1682fec185fe7537370370f202abc454b6b3a (patch)
tree4afcfe60535045ea76356cde8dd2953cd46942b2 /net/ethtool
parente570b15087532919688979b6ead02bb5b890b082 (diff)
downloadlinux-stable-5ff1682fec185fe7537370370f202abc454b6b3a.tar.gz
linux-stable-5ff1682fec185fe7537370370f202abc454b6b3a.tar.bz2
linux-stable-5ff1682fec185fe7537370370f202abc454b6b3a.zip
ethtool: don't propagate EOPNOTSUPP from dumps
[ Upstream commit cbeb989e41f4094f54bec2cecce993f26f547bea ] The default dump handler needs to clear ret before returning. Otherwise if the last interface returns an inconsequential error this error will propagate to user space. This may confuse user space (ethtool CLI seems to ignore it, but YNL doesn't). It will also terminate the dump early for mutli-skb dump, because netlink core treats EOPNOTSUPP as a real error. Fixes: 728480f12442 ("ethtool: default handlers for GET requests") Reviewed-by: Simon Horman <horms@kernel.org> Link: https://lore.kernel.org/r/20231126225806.2143528-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/ethtool')
-rw-r--r--net/ethtool/netlink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ethtool/netlink.c b/net/ethtool/netlink.c
index 1a4c11356c96..fc4ccecf9495 100644
--- a/net/ethtool/netlink.c
+++ b/net/ethtool/netlink.c
@@ -509,7 +509,7 @@ lock_and_cont:
cont:
idx++;
}
-
+ ret = 0;
}
rtnl_unlock();