diff options
-rw-r--r-- | net/dsa/dsa2.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c index d5f21a770689..04065d3fb09f 100644 --- a/net/dsa/dsa2.c +++ b/net/dsa/dsa2.c @@ -568,9 +568,7 @@ static void dsa_port_teardown(struct dsa_port *dp) { struct devlink_port *dlp = &dp->devlink_port; struct dsa_switch *ds = dp->ds; - struct dsa_mac_addr *a, *tmp; struct net_device *slave; - struct dsa_vlan *v, *n; if (!dp->setup) return; @@ -601,20 +599,9 @@ static void dsa_port_teardown(struct dsa_port *dp) break; } - list_for_each_entry_safe(a, tmp, &dp->fdbs, list) { - list_del(&a->list); - kfree(a); - } - - list_for_each_entry_safe(a, tmp, &dp->mdbs, list) { - list_del(&a->list); - kfree(a); - } - - list_for_each_entry_safe(v, n, &dp->vlans, list) { - list_del(&v->list); - kfree(v); - } + WARN_ON(!list_empty(&dp->fdbs)); + WARN_ON(!list_empty(&dp->mdbs)); + WARN_ON(!list_empty(&dp->vlans)); dp->setup = false; } |