From: Mathieu Desnoyers Date: Wed, 21 Sep 2011 17:59:09 +0000 (-0400) Subject: rculfhash: set next to NULL when node is NULL X-Git-Tag: v0.7.0~43^2~127 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=96ad111233eea0c9fb81cfb79f559f22f38b1d0e;p=userspace-rcu.git rculfhash: set next to NULL when node is NULL Signed-off-by: Mathieu Desnoyers --- diff --git a/rculfhash.c b/rculfhash.c index cd25d33..8ed9c10 100644 --- a/rculfhash.c +++ b/rculfhash.c @@ -1280,11 +1280,11 @@ void cds_lfht_lookup(struct cds_lfht *ht, void *key, size_t key_len, node = clear_flag(node); for (;;) { if (unlikely(is_end(node))) { - node = NULL; + node = next = NULL; break; } if (unlikely(node->p.reverse_hash > reverse_hash)) { - node = NULL; + node = next = NULL; break; } next = rcu_dereference(node->p.next); @@ -1316,11 +1316,11 @@ void cds_lfht_next(struct cds_lfht *ht, struct cds_lfht_iter *iter) for (;;) { if (unlikely(is_end(node))) { - node = NULL; + node = next = NULL; break; } if (unlikely(node->p.reverse_hash > reverse_hash)) { - node = NULL; + node = next = NULL; break; } next = rcu_dereference(node->p.next);