diff options
author | Marek Lindner <lindner_marek@yahoo.de> | 2011-02-18 12:28:11 +0000 |
---|---|---|
committer | Marek Lindner <lindner_marek@yahoo.de> | 2011-03-05 12:52:03 +0100 |
commit | 1605d0d60b66b9461cfcff86f8cfc80964f23430 (patch) | |
tree | d35ad73ad4ac6cc157383d611101d3dd66115745 /net/batman-adv/originator.c | |
parent | 7b36e8eef989fc59535b4f1d3fc0f83afaf419d4 (diff) |
batman-adv: increase refcount in create_neighbor to be consistent
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Diffstat (limited to 'net/batman-adv/originator.c')
-rw-r--r-- | net/batman-adv/originator.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c index a70debebfc5..69e27a243fd 100644 --- a/net/batman-adv/originator.c +++ b/net/batman-adv/originator.c @@ -94,7 +94,9 @@ struct neigh_node *create_neighbor(struct orig_node *orig_node, memcpy(neigh_node->addr, neigh, ETH_ALEN); neigh_node->orig_node = orig_neigh_node; neigh_node->if_incoming = if_incoming; - atomic_set(&neigh_node->refcount, 1); + + /* extra reference for return */ + atomic_set(&neigh_node->refcount, 2); spin_lock_bh(&orig_node->neigh_list_lock); hlist_add_head_rcu(&neigh_node->list, &orig_node->neigh_list); |