|
@@ -594,6 +594,7 @@ int batadv_softif_create_vlan(struct batadv_priv *bat_priv, unsigned short vid)
|
|
}
|
|
}
|
|
|
|
|
|
spin_lock_bh(&bat_priv->softif_vlan_list_lock);
|
|
spin_lock_bh(&bat_priv->softif_vlan_list_lock);
|
|
|
|
+ kref_get(&vlan->refcount);
|
|
hlist_add_head_rcu(&vlan->list, &bat_priv->softif_vlan_list);
|
|
hlist_add_head_rcu(&vlan->list, &bat_priv->softif_vlan_list);
|
|
spin_unlock_bh(&bat_priv->softif_vlan_list_lock);
|
|
spin_unlock_bh(&bat_priv->softif_vlan_list_lock);
|
|
|
|
|
|
@@ -604,6 +605,9 @@ int batadv_softif_create_vlan(struct batadv_priv *bat_priv, unsigned short vid)
|
|
bat_priv->soft_iface->dev_addr, vid,
|
|
bat_priv->soft_iface->dev_addr, vid,
|
|
BATADV_NULL_IFINDEX, BATADV_NO_MARK);
|
|
BATADV_NULL_IFINDEX, BATADV_NO_MARK);
|
|
|
|
|
|
|
|
+ /* don't return reference to new softif_vlan */
|
|
|
|
+ batadv_softif_vlan_put(vlan);
|
|
|
|
+
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|