From: Michael S. Tsirkin Date: Thu, 1 Aug 2013 10:50:10 +0000 (+0300) Subject: macvlan: handle set_promiscuity failures X-Git-Tag: upstream/snapshot3+hdmi~4603^2~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=787381415cf967c5d6d1d7c5b5bd893376945edd;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git macvlan: handle set_promiscuity failures It's quite unlikely that dev_set_promiscuity will fail, but worth checking just in case. Cc: "David S. Miller" Signed-off-by: Michael S. Tsirkin Signed-off-by: David S. Miller --- diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 13937f9..d0f9c2f 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -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; }