From dd51e0ad14ab677d0fab45b492150adce2ee863e Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 7 Sep 2011 17:15:20 -0700 Subject: [PATCH] rculfhash: deal with resize to size 1 corner-case Signed-off-by: Mathieu Desnoyers --- rculfhash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rculfhash.c b/rculfhash.c index cd60f5f..b74739f 100644 --- a/rculfhash.c +++ b/rculfhash.c @@ -803,7 +803,7 @@ int _cds_lfht_remove(struct cds_lfht *ht, struct rcu_table *t, */ if (dummy_removal) - index = hash & ((t->size >> 1) - 1); + index = hash & ((t->size == 1) ? 0 : (t->size >> 1) - 1); else index = hash & (t->size - 1); order = get_count_order_ulong(index + 1); -- 2.34.1