]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: fix feature changes on devices without ndo_set_features
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Fri, 13 Nov 2015 13:54:01 +0000 (14:54 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 Nov 2015 19:56:03 +0000 (14:56 -0500)
When __netdev_update_features() was updated to ensure some features are
disabled on new lower devices, an error was introduced for devices which
don't have the ndo_set_features() method set. Before we'll just set the
new features, but now we return an error and don't set them. Fix this by
returning the old behaviour and setting err to 0 when ndo_set_features
is not present.

Fixes: e7868a85e1b2 ("net/core: ensure features get disabled on new lower devs")
CC: Jarod Wilson <jarod@redhat.com>
CC: Jiri Pirko <jiri@resnulli.us>
CC: Ido Schimmel <idosch@mellanox.com>
CC: Sander Eikelenboom <linux@eikelenboom.it>
CC: Andy Gospodarek <gospo@cumulusnetworks.com>
CC: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Andy Gospodarek <gospo@cumulusnetworks.com>
Reviewed-by: Jarod Wilson <jarod@redhat.com>
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Tested-by: Dave Young <dyoung@redhat.com>
Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c

index ab9b8d0d115e4ce479fed2aa8304947be09f1f32..4a1d198dbbfff10823b070326228bdd4659e9b49 100644 (file)
@@ -6426,6 +6426,8 @@ int __netdev_update_features(struct net_device *dev)
 
        if (dev->netdev_ops->ndo_set_features)
                err = dev->netdev_ops->ndo_set_features(dev, features);
+       else
+               err = 0;
 
        if (unlikely(err < 0)) {
                netdev_err(dev,