From: Johannes Berg Date: Wed, 7 Oct 2020 10:53:51 +0000 (+0200) Subject: ethtool: correct policy for ETHTOOL_MSG_CHANNELS_SET X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=fd15dd0586896392f6f29daa5b9eeb6c1b18df6a;p=linux.git ethtool: correct policy for ETHTOOL_MSG_CHANNELS_SET This accidentally got wired up to the *get* policy instead of the *set* policy, causing operations to be rejected. Fix it by wiring up the correct policy instead. Fixes: 5028588b62cb ("ethtool: wire up set policies to ops") Reported-by: Leon Romanovsky Signed-off-by: Johannes Berg Tested-by: Leon Romanovsky Reviewed-by: Jakub Kicinski Signed-off-by: Jakub Kicinski --- diff --git a/net/ethtool/netlink.c b/net/ethtool/netlink.c index 8a85a4e6be9b0..50d3c8896f917 100644 --- a/net/ethtool/netlink.c +++ b/net/ethtool/netlink.c @@ -830,8 +830,8 @@ static const struct genl_ops ethtool_genl_ops[] = { .cmd = ETHTOOL_MSG_CHANNELS_SET, .flags = GENL_UNS_ADMIN_PERM, .doit = ethnl_set_channels, - .policy = ethnl_channels_get_policy, - .maxattr = ARRAY_SIZE(ethnl_channels_get_policy) - 1, + .policy = ethnl_channels_set_policy, + .maxattr = ARRAY_SIZE(ethnl_channels_set_policy) - 1, }, { .cmd = ETHTOOL_MSG_COALESCE_GET,