• Sven Eckelmann's avatar
    batman-adv: Only put orig_node_vlan list reference when removed · 3db15209
    Sven Eckelmann authored
    The batadv_orig_node_vlan reference counter in batadv_tt_global_size_mod
    can only be reduced when the list entry was actually removed. Otherwise the
    reference counter may reach zero when batadv_tt_global_size_mod is called
    from two different contexts for the same orig_node_vlan but only one
    context is actually removing the entry from the list.
    
    The release function for this orig_node_vlan is not called inside the
    vlan_list_lock spinlock protected region because the function
    batadv_tt_global_size_mod still holds a orig_node_vlan reference for the
    object pointer on the stack. Thus the actual release function (when
    required) will be called only at the end of the function.
    
    Fixes: 7ea7b4a1 ("batman-adv: make the TT CRC logic VLAN specific")
    Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
    Signed-off-by: default avatarMarek Lindner <mareklindner@neomailbox.ch>
    Signed-off-by: default avatarAntonio Quartulli <a@unstable.cc>
    3db15209
translation-table.c 113 KB