The following commit has been merged in the merge/master branch: commit 839de35a45a3d9586c08a07f3412fa46b1f4131d Merge: ab08dfe956b8a116ad29966be3a32ae4bced70fe 6219a1b400d38fbdce22ba252e68bc883b32c73c Author: Marek Lindner mareklindner@neomailbox.ch Date: Thu Jan 7 00:05:20 2016 +0800
Merge branch 'next'
diff --combined net/batman-adv/originator.c index d577760,2681c7d..faccadc --- a/net/batman-adv/originator.c +++ b/net/batman-adv/originator.c @@@ -1,4 -1,4 +1,4 @@@ -/* Copyright (C) 2009-2015 B.A.T.M.A.N. contributors: +/* Copyright (C) 2009-2016 B.A.T.M.A.N. contributors: * * Marek Lindner, Simon Wunderlich * @@@ -217,10 -217,6 +217,6 @@@ static void batadv_hardif_neigh_free_rc
hardif_neigh = container_of(rcu, struct batadv_hardif_neigh_node, rcu);
- spin_lock_bh(&hardif_neigh->if_incoming->neigh_list_lock); - hlist_del_init_rcu(&hardif_neigh->list); - spin_unlock_bh(&hardif_neigh->if_incoming->neigh_list_lock); - batadv_hardif_free_ref_now(hardif_neigh->if_incoming); kfree(hardif_neigh); } @@@ -233,8 -229,13 +229,13 @@@ static void batadv_hardif_neigh_free_now(struct batadv_hardif_neigh_node *hardif_neigh) { - if (atomic_dec_and_test(&hardif_neigh->refcount)) + if (atomic_dec_and_test(&hardif_neigh->refcount)) { + spin_lock_bh(&hardif_neigh->if_incoming->neigh_list_lock); + hlist_del_init_rcu(&hardif_neigh->list); + spin_unlock_bh(&hardif_neigh->if_incoming->neigh_list_lock); + batadv_hardif_neigh_free_rcu(&hardif_neigh->rcu); + } }
/** @@@ -244,8 -245,13 +245,13 @@@ */ void batadv_hardif_neigh_free_ref(struct batadv_hardif_neigh_node *hardif_neigh) { - if (atomic_dec_and_test(&hardif_neigh->refcount)) + if (atomic_dec_and_test(&hardif_neigh->refcount)) { + spin_lock_bh(&hardif_neigh->if_incoming->neigh_list_lock); + hlist_del_init_rcu(&hardif_neigh->list); + spin_unlock_bh(&hardif_neigh->if_incoming->neigh_list_lock); + call_rcu(&hardif_neigh->rcu, batadv_hardif_neigh_free_rcu); + } }
/**