diff options
Diffstat (limited to 'net/batman-adv/routing.c')
-rw-r--r-- | net/batman-adv/routing.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index 827414067e46..36351d374f28 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c | |||
@@ -89,6 +89,8 @@ static void update_route(struct bat_priv *bat_priv, | |||
89 | struct neigh_node *neigh_node, | 89 | struct neigh_node *neigh_node, |
90 | unsigned char *hna_buff, int hna_buff_len) | 90 | unsigned char *hna_buff, int hna_buff_len) |
91 | { | 91 | { |
92 | struct neigh_node *neigh_node_tmp; | ||
93 | |||
92 | /* route deleted */ | 94 | /* route deleted */ |
93 | if ((orig_node->router) && (!neigh_node)) { | 95 | if ((orig_node->router) && (!neigh_node)) { |
94 | 96 | ||
@@ -115,7 +117,12 @@ static void update_route(struct bat_priv *bat_priv, | |||
115 | orig_node->router->addr); | 117 | orig_node->router->addr); |
116 | } | 118 | } |
117 | 119 | ||
120 | if (neigh_node) | ||
121 | kref_get(&neigh_node->refcount); | ||
122 | neigh_node_tmp = orig_node->router; | ||
118 | orig_node->router = neigh_node; | 123 | orig_node->router = neigh_node; |
124 | if (neigh_node_tmp) | ||
125 | kref_put(&neigh_node_tmp->refcount, neigh_node_free_ref); | ||
119 | } | 126 | } |
120 | 127 | ||
121 | 128 | ||