Skip to content

Commit 5454f5c

Browse files
vladimirolteandavem330
authored andcommitted
net: bridge: vlan: check for errors from __vlan_del in __vlan_flush
If the following call path returns an error from switchdev: nbp_vlan_flush -> __vlan_del -> __vlan_vid_del -> br_switchdev_port_vlan_del -> __vlan_group_free -> WARN_ON(!list_empty(&vg->vlan_list)); then the deletion of the net_bridge_vlan is silently halted, which will trigger the WARN_ON from __vlan_group_free(). The WARN_ON is rather unhelpful, because nothing about the source of the error is printed. Add a print to catch errors from __vlan_del. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 25ce79d commit 5454f5c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

net/bridge/br_vlan.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ static void __vlan_flush(const struct net_bridge *br,
404404
{
405405
struct net_bridge_vlan *vlan, *tmp;
406406
u16 v_start = 0, v_end = 0;
407+
int err;
407408

408409
__vlan_delete_pvid(vg, vg->pvid);
409410
list_for_each_entry_safe(vlan, tmp, &vg->vlan_list, vlist) {
@@ -417,7 +418,13 @@ static void __vlan_flush(const struct net_bridge *br,
417418
}
418419
v_end = vlan->vid;
419420

420-
__vlan_del(vlan);
421+
err = __vlan_del(vlan);
422+
if (err) {
423+
br_err(br,
424+
"port %u(%s) failed to delete vlan %d: %pe\n",
425+
(unsigned int) p->port_no, p->dev->name,
426+
vlan->vid, ERR_PTR(err));
427+
}
421428
}
422429

423430
/* notify about the last/whole vlan range */

0 commit comments

Comments
 (0)