net: fix __netdev_update_features return on ndo_set_features failure
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Fri, 13 Nov 2015 14:20:24 +0000 (15:20 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 Nov 2015 19:56:03 +0000 (14:56 -0500)
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>
net/core/dev.c

index 4a1d198dbbfff10823b070326228bdd4659e9b49..1974aee005a65a3adf8faf86d8e8db200bba6551 100644 (file)
@@ -6433,7 +6433,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;
        }
 
 sync_lower: