From 96ad111233eea0c9fb81cfb79f559f22f38b1d0e Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 21 Sep 2011 13:59:09 -0400 Subject: [PATCH] rculfhash: set next to NULL when node is NULL Signed-off-by: Mathieu Desnoyers --- rculfhash.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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); -- 2.34.1