Skip to content

Commit

Permalink
net/core: revert "net: fix __netdev_update_features return.." and add…
Browse files Browse the repository at this point in the history
… comment

commit 17b85d2 upstream.

This reverts commit 00ee592 ("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 <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>
  • Loading branch information
Nikolay Aleksandrov authored and Zefan Li committed Oct 26, 2016
1 parent 17fd6bb commit 86eecef
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 86eecef

Please sign in to comment.