macvlan: handle set_promiscuity failures
authorMichael S. Tsirkin <mst@redhat.com>
Thu, 1 Aug 2013 10:50:10 +0000 (13:50 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 1 Aug 2013 23:32:05 +0000 (16:32 -0700)
It's quite unlikely that dev_set_promiscuity will fail,
but worth checking just in case.

Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/macvlan.c

index 13937f9c04ad276e22ee973ba7584c201947d8de..d0f9c2fd1d4fdaa06110d394411f48bb5f8874bb 100644 (file)
@@ -337,8 +337,11 @@ static int macvlan_open(struct net_device *dev)
        int err;
 
        if (vlan->port->passthru) {
-               if (!(vlan->flags & MACVLAN_FLAG_NOPROMISC))
-                       dev_set_promiscuity(lowerdev, 1);
+               if (!(vlan->flags & MACVLAN_FLAG_NOPROMISC)) {
+                       err = dev_set_promiscuity(lowerdev, 1);
+                       if (err < 0)
+                               goto out;
+               }
                goto hash_add;
        }