summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>2015-11-13 15:20:24 +0100
committerZefan Li <lizefan@huawei.com>2016-10-26 23:15:29 +0800
commita73cb24083e4068c8a7b7de4820e4906f78651b8 (patch)
tree80362dd610676ba64ca43f040fbaebe478ffcad1
parentf4ea18fe5670fd16215344eaf3f7bfd7f19e0012 (diff)
downloadlinux-stable-a73cb24083e4068c8a7b7de4820e4906f78651b8.tar.gz
linux-stable-a73cb24083e4068c8a7b7de4820e4906f78651b8.tar.bz2
linux-stable-a73cb24083e4068c8a7b7de4820e4906f78651b8.zip
net: fix __netdev_update_features return on ndo_set_features failure
commit 00ee5927177792a6e139d50b6b7564d35705556a 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: 6cb6a27c45ce ("net: Call netdev_features_change() from netdev_update_features()") CC: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Zefan Li <lizefan@huawei.com>
-rw-r--r--net/core/dev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 4f679bf4f12e..1f57ab1c6adf 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5368,7 +5368,7 @@ int __netdev_update_features(struct net_device *dev)
netdev_err(dev,
"set_features() failed (%d); wanted %pNF, left %pNF\n",
err, &features, &dev->features);
- return -1;
+ return 0;
}
if (!err)