On Saturday, March 05, 2016 15:53:47 Sven Eckelmann wrote:
--- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c @@ -104,6 +104,8 @@ static void _batadv_update_route(struct batadv_priv *bat_priv, neigh_node = NULL;
spin_lock_bh(&orig_node->neigh_list_lock);
curr_router = rcu_dereference_protected(orig_ifinfo->router, true);
rcu_assign_pointer(orig_ifinfo->router, neigh_node); spin_unlock_bh(&orig_node->neigh_list_lock); batadv_orig_ifinfo_free_ref(orig_ifinfo);
Don't we also need to check for curr_router->refcount > 0 to mimic the check above ? Maybe a negative refcount does not hurt or is it unsigned ?
Cheers, Marek