X-Git-Url: http://git.monstr.eu/?a=blobdiff_plain;f=net%2Fbatman-adv%2Frouting.c;h=d343382e966415d4fdd66a32f2f420951612e50a;hb=cf78bb0bbcef3fbe1abf118f14b81dad36eaa94e;hp=3632bd976c56ca8959b09bd9cd947da98378fc28;hpb=86ce3c90c910110540ac25cae5d9b90b268542bd;p=linux-2.6-microblaze.git diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index 3632bd976c56..d343382e9664 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c @@ -71,13 +71,13 @@ static void _batadv_update_route(struct batadv_priv *bat_priv, * the code needs to ensure the curr_router variable contains a pointer * to the replaced best neighbor. */ - curr_router = rcu_dereference_protected(orig_ifinfo->router, true); /* increase refcount of new best neighbor */ if (neigh_node) kref_get(&neigh_node->refcount); - rcu_assign_pointer(orig_ifinfo->router, neigh_node); + curr_router = rcu_replace_pointer(orig_ifinfo->router, neigh_node, + true); spin_unlock_bh(&orig_node->neigh_list_lock); batadv_orig_ifinfo_put(orig_ifinfo);