diff mbox series

[2/2] ethtool: correct policy for ETHTOOL_MSG_CHANNELS_SET

Message ID 20201007125348.a74389e18168.Ieab7a871e27b9698826e75dc9e825e4ddbc852b1@changeid (mailing list archive)
State Not Applicable
Headers show
Series [1/2] ethtool: strset: allow ETHTOOL_A_STRSET_COUNTS_ONLY attr | expand

Commit Message

Johannes Berg Oct. 7, 2020, 10:53 a.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

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>
---
 net/ethtool/netlink.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Leon Romanovsky Oct. 7, 2020, 11:18 a.m. UTC | #1
On Wed, Oct 07, 2020 at 12:53:51PM +0200, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> 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>
> ---
>  net/ethtool/netlink.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>

Thanks,
Tested-by: Leon Romanovsky <leonro@nvidia.com>
Jakub Kicinski Oct. 7, 2020, 3:12 p.m. UTC | #2
On Wed,  7 Oct 2020 12:53:51 +0200 Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> 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>

Reviewed-by: Jakub Kicinski <kuba@kernel.org>

Thanks!
diff mbox series

Patch

diff --git a/net/ethtool/netlink.c b/net/ethtool/netlink.c
index 8a85a4e6be9b..50d3c8896f91 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,