Commit bb62cdf5 authored by Nikolay Aleksandrov's avatar Nikolay Aleksandrov Committed by Ben Hutchings

net: fix __netdev_update_features return on ndo_set_features failure

commit 00ee5927 upstream.

If ndo_set_features fails __netdev_update_features() will return -1 but
this is wrong because it is expected to return 0 if no features were
changed (see netdev_update_features()), which will cause a netdev
notifier to be called without any actual changes. Fix this by returning
0 if ndo_set_features fails.

Fixes: 6cb6a27c ("net: Call netdev_features_change() from netdev_update_features()")
CC: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent ba502185
...@@ -5446,7 +5446,7 @@ int __netdev_update_features(struct net_device *dev) ...@@ -5446,7 +5446,7 @@ int __netdev_update_features(struct net_device *dev)
netdev_err(dev, netdev_err(dev,
"set_features() failed (%d); wanted 0x%08x, left 0x%08x\n", "set_features() failed (%d); wanted 0x%08x, left 0x%08x\n",
err, features, dev->features); err, features, dev->features);
return -1; return 0;
} }
if (!err) if (!err)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment