From: Mathieu Desnoyers Date: Thu, 8 Sep 2011 00:15:20 +0000 (-0700) Subject: rculfhash: deal with resize to size 1 corner-case X-Git-Tag: v0.7.0~43^2~173 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=dd51e0ad14ab677d0fab45b492150adce2ee863e;p=userspace-rcu.git rculfhash: deal with resize to size 1 corner-case Signed-off-by: Mathieu Desnoyers --- 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);