Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <leon@kernel.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Tested-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Johannes Berg and committed by
Jakub Kicinski
fd15dd05 db972e53

+2 -2
+2 -2
net/ethtool/netlink.c
··· 830 830 .cmd = ETHTOOL_MSG_CHANNELS_SET, 831 831 .flags = GENL_UNS_ADMIN_PERM, 832 832 .doit = ethnl_set_channels, 833 - .policy = ethnl_channels_get_policy, 834 - .maxattr = ARRAY_SIZE(ethnl_channels_get_policy) - 1, 833 + .policy = ethnl_channels_set_policy, 834 + .maxattr = ARRAY_SIZE(ethnl_channels_set_policy) - 1, 835 835 }, 836 836 { 837 837 .cmd = ETHTOOL_MSG_COALESCE_GET,