Skip to contentSkip to conversation

macvlan: handle set_promiscuity failures

PATCH New Michael S. Tsirkin 1 participant 1 message Aug 1, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 macvlan: handle set_promiscuity failures

It's quite unlikely that dev_set_promiscuity will fail, but worth checking just in case.

---
 drivers/net/macvlan.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/macvlan.c +5 -2
index 13937f9..d0f9c2f 100644
@@ -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;
 	}
 
Signature · 1 line
MST