public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
* [PATCH net] net: fix __netdev_update_features return on ndo_set_features failure
@ 2015-11-13 14:20 Nikolay Aleksandrov
  2015-11-16 19:56 ` David Miller
  2015-11-17 13:54 ` Michał Mirosław
  0 siblings, 2 replies; 6+ messages in thread
From: Nikolay Aleksandrov @ 2015-11-13 14:20 UTC (permalink / raw)
  To: netdev; +Cc: davem, Nikolay Aleksandrov, Michał Mirosław

From: Nikolay Aleksandrov <nikolay@cumulusnetworks•com>

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>
---
 net/core/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 4a1d198dbbff..1974aee005a6 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -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:
-- 
2.4.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-11-17 20:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-13 14:20 [PATCH net] net: fix __netdev_update_features return on ndo_set_features failure Nikolay Aleksandrov
2015-11-16 19:56 ` David Miller
2015-11-17 13:54 ` Michał Mirosław
2015-11-17 14:31   ` Nikolay Aleksandrov
2015-11-17 14:49     ` [PATCH net] net/core: revert "net: fix __netdev_update_features return.." and add comment Nikolay Aleksandrov
2015-11-17 20:27       ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox