summaryrefslogtreecommitdiffstats
path: root/net/batman-adv/originator.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/batman-adv/originator.c')
-rw-r--r--net/batman-adv/originator.c4
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);