From: Nikolay Aleksandrov Date: Tue, 17 Nov 2015 14:49:06 +0000 (+0100) Subject: net/core: revert "net: fix __netdev_update_features return.." and add comment X-Git-Tag: v3.4.113~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86eecef7f9d182c759c687020a504235c6bef903;p=thirdparty%2Fkernel%2Fstable.git net/core: revert "net: fix __netdev_update_features return.." and add comment commit 17b85d29e82cc3c874a497a8bc5764d6a2b043e2 upstream. This reverts commit 00ee59271777 ("net: fix __netdev_update_features return on ndo_set_features failure") and adds a comment explaining why it's okay to return a value other than 0 upon error. Some drivers might actually change flags and return an error so it's better to fire a spurious notification rather than miss these. CC: Michał Mirosław Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller Signed-off-by: Zefan Li --- diff --git a/net/core/dev.c b/net/core/dev.c index 1f57ab1c6adf4..573d62b9cbeba 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -5368,7 +5368,10 @@ 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 0; + /* return non-0 since some features might have changed and + * it's better to fire a spurious notification than miss it + */ + return -1; } if (!err)