diff options
-rw-r--r-- | net/core/ethtool.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/core/ethtool.c b/net/core/ethtool.c index 13d79f5a86e5..d8b1a8d85a96 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c | |||
@@ -546,12 +546,12 @@ int __ethtool_set_flags(struct net_device *dev, u32 data) | |||
546 | } | 546 | } |
547 | 547 | ||
548 | /* allow changing only bits set in hw_features */ | 548 | /* allow changing only bits set in hw_features */ |
549 | changed = (data ^ dev->wanted_features) & flags_dup_features; | 549 | changed = (data ^ dev->features) & flags_dup_features; |
550 | if (changed & ~dev->hw_features) | 550 | if (changed & ~dev->hw_features) |
551 | return (changed & dev->hw_features) ? -EINVAL : -EOPNOTSUPP; | 551 | return (changed & dev->hw_features) ? -EINVAL : -EOPNOTSUPP; |
552 | 552 | ||
553 | dev->wanted_features = | 553 | dev->wanted_features = |
554 | (dev->wanted_features & ~changed) | data; | 554 | (dev->wanted_features & ~changed) | (data & dev->hw_features); |
555 | 555 | ||
556 | __netdev_update_features(dev); | 556 | __netdev_update_features(dev); |
557 | 557 | ||