aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge
diff options
context:
space:
mode:
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>2015-09-05 21:27:57 -0400
committerDavid S. Miller <davem@davemloft.net>2015-09-09 01:28:45 -0400
commitbf361ad38165939049a2649b1a0078f3268d4bd1 (patch)
treecd5ba4177af6ec40455199e8e7df4444a2fd37bd /net/bridge
parent39797a279d62972cd914ef580fdfacb13e508bf8 (diff)
net: bridge: check __vlan_vid_del for error
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 <vivien.didelot@savoirfairelinux.com> Acked-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge')
-rw-r--r--net/bridge/br_vlan.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c
index 3cd8cc9e804b..5f5a02b49a99 100644
--- a/net/bridge/br_vlan.c
+++ b/net/bridge/br_vlan.c
@@ -117,10 +117,11 @@ out_filt:
117 return err; 117 return err;
118} 118}
119 119
120static void __vlan_vid_del(struct net_device *dev, struct net_bridge *br, 120static int __vlan_vid_del(struct net_device *dev, struct net_bridge *br,
121 u16 vid) 121 u16 vid)
122{ 122{
123 const struct net_device_ops *ops = dev->netdev_ops; 123 const struct net_device_ops *ops = dev->netdev_ops;
124 int err = 0;
124 125
125 /* If driver uses VLAN ndo ops, use 8021q to delete vid 126 /* If driver uses VLAN ndo ops, use 8021q to delete vid
126 * on device, otherwise try switchdev ops to delete vid. 127 * on device, otherwise try switchdev ops to delete vid.
@@ -137,8 +138,12 @@ static void __vlan_vid_del(struct net_device *dev, struct net_bridge *br,
137 }, 138 },
138 }; 139 };
139 140
140 switchdev_port_obj_del(dev, &vlan_obj); 141 err = switchdev_port_obj_del(dev, &vlan_obj);
142 if (err == -EOPNOTSUPP)
143 err = 0;
141 } 144 }
145
146 return err;
142} 147}
143 148
144static int __vlan_del(struct net_port_vlans *v, u16 vid) 149static int __vlan_del(struct net_port_vlans *v, u16 vid)
@@ -151,7 +156,11 @@ static int __vlan_del(struct net_port_vlans *v, u16 vid)
151 156
152 if (v->port_idx) { 157 if (v->port_idx) {
153 struct net_bridge_port *p = v->parent.port; 158 struct net_bridge_port *p = v->parent.port;
154 __vlan_vid_del(p->dev, p->br, vid); 159 int err;
160
161 err = __vlan_vid_del(p->dev, p->br, vid);
162 if (err)
163 return err;
155 } 164 }
156 165
157 clear_bit(vid, v->vlan_bitmap); 166 clear_bit(vid, v->vlan_bitmap);