Skip to content

Commit

Permalink
net: bridge: check __vlan_vid_del for error
Browse files Browse the repository at this point in the history
Since __vlan_del can return an error code, change its inner function
__vlan_vid_del to return an eventual error from switchdev_port_obj_del.

Signed-off-by: Vivien Didelot <[email protected]>
Acked-by: Jiri Pirko <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
vivien authored and davem330 committed Sep 9, 2015
1 parent 39797a2 commit bf361ad
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions net/bridge/br_vlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,11 @@ static int __vlan_add(struct net_port_vlans *v, u16 vid, u16 flags)
return err;
}

static void __vlan_vid_del(struct net_device *dev, struct net_bridge *br,
u16 vid)
static int __vlan_vid_del(struct net_device *dev, struct net_bridge *br,
u16 vid)
{
const struct net_device_ops *ops = dev->netdev_ops;
int err = 0;

/* If driver uses VLAN ndo ops, use 8021q to delete vid
* on device, otherwise try switchdev ops to delete vid.
Expand All @@ -137,8 +138,12 @@ static void __vlan_vid_del(struct net_device *dev, struct net_bridge *br,
},
};

switchdev_port_obj_del(dev, &vlan_obj);
err = switchdev_port_obj_del(dev, &vlan_obj);
if (err == -EOPNOTSUPP)
err = 0;
}

return err;
}

static int __vlan_del(struct net_port_vlans *v, u16 vid)
Expand All @@ -151,7 +156,11 @@ static int __vlan_del(struct net_port_vlans *v, u16 vid)

if (v->port_idx) {
struct net_bridge_port *p = v->parent.port;
__vlan_vid_del(p->dev, p->br, vid);
int err;

err = __vlan_vid_del(p->dev, p->br, vid);
if (err)
return err;
}

clear_bit(vid, v->vlan_bitmap);
Expand Down

0 comments on commit bf361ad

Please sign in to comment.