Hi Marek,
@@ -108,7 +110,12 @@ static void update_route(struct bat_priv *bat_priv, orig_node->router->addr); }
- neigh_node_tmp = orig_node->router; orig_node->router = neigh_node;
- if (orig_node->router)
kref_get(&orig_node->router->refcount);
- if (neigh_node_tmp)
kref_put(&neigh_node->refcount, neigh_node_free_ref);
}
I guess you meant "kref_put(&neigh_node_tmp,... instead of neigh_node (without tmp) here, as neigh_node_tmp won't be used anymore, not neigh_node, right? Otherwise it also does not seem to make sense to first increase the refcount and then decreasing it right again after the additional check.