From: Antonio Quartulli antonio@open-mesh.com
Introduced by e4ff5c153dab054a6cd1c4132f87bc5e77127456 ("batman-adv: add sysfs framework for VLAN")
Signed-off-by: Antonio Quartulli antonio@open-mesh.com --- soft-interface.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/soft-interface.c b/soft-interface.c index 7cd23f5..d018c49 100644 --- a/soft-interface.c +++ b/soft-interface.c @@ -457,17 +457,20 @@ int batadv_softif_create_vlan(struct batadv_priv *bat_priv, unsigned short vid) vlan->vid = vid; atomic_set(&vlan->refcount, 1);
+ atomic_set(&vlan->ap_isolation, 0); + + err = batadv_sysfs_add_vlan(bat_priv->soft_iface, vlan); + if (err) { + kfree(vlan); + return err; + } + /* add a new TT local entry. This one will be marked with the NOPURGE * flag */ batadv_tt_local_add(bat_priv->soft_iface, bat_priv->soft_iface->dev_addr, vid, BATADV_NULL_IFINDEX); - atomic_set(&vlan->ap_isolation, 0); - - err = batadv_sysfs_add_vlan(bat_priv->soft_iface, vlan); - if (err) - return err;
spin_lock_bh(&bat_priv->softif_vlan_list_lock); hlist_add_head_rcu(&vlan->list, &bat_priv->softif_vlan_list);