X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=urcu-ht.c;h=e3fd3137a9273795bb6842b110a47774120ae5ae;hb=7ce4eb3848a2d2bdd6a267bfddfc8a36fcd45d66;hp=a26878fd347ccf22294509960fcf95a6cc67f1d3;hpb=2e6070d0f3c445476172dda329ae5d2a981a4986;p=urcu.git diff --git a/urcu-ht.c b/urcu-ht.c index a26878f..e3fd313 100644 --- a/urcu-ht.c +++ b/urcu-ht.c @@ -166,7 +166,7 @@ retry: node = rcu_dereference(*prev); } /* Found it ! pointer to object is in "prev" */ - if (rcu_cmpxchg_pointer(prev, node, node->next) != node) + if (rcu_cmpxchg_pointer(prev, node, node->next) == node) del_node = node; goto restart; @@ -177,8 +177,8 @@ end: */ rcu_read_unlock(); - data = node->data; - call_rcu(free, node); + data = del_node->data; + call_rcu(free, del_node); return data; error: