From: Jakub Kicinski Date: Sun, 26 Nov 2023 22:58:06 +0000 (-0800) Subject: ethtool: don't propagate EOPNOTSUPP from dumps X-Git-Tag: v6.6.7~279 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=61ae993c308fb91e889604efd410ebf84b975440;p=platform%2Fkernel%2Flinux-starfive.git 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 Link: https://lore.kernel.org/r/20231126225806.2143528-1-kuba@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- diff --git a/net/ethtool/netlink.c b/net/ethtool/netlink.c index 3bbd5af..fe3553f 100644 --- a/net/ethtool/netlink.c +++ b/net/ethtool/netlink.c @@ -505,6 +505,7 @@ static int ethnl_default_dumpit(struct sk_buff *skb, ret = skb->len; break; } + ret = 0; } rtnl_unlock();