From 49619ea0bfe494a27a62991e5360f0de8e4bdf1f Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Sat, 3 Sep 2011 14:33:06 -0400 Subject: [PATCH] rculfhash: power power of two check should allow 0 Signed-off-by: Mathieu Desnoyers --- rculfhash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rculfhash.c b/rculfhash.c index 807a22d..174c11c 100644 --- a/rculfhash.c +++ b/rculfhash.c @@ -622,7 +622,7 @@ struct cds_lfht *cds_lfht_new(cds_lfht_hash_fct hash_fct, unsigned long order; /* init_size must be power of two */ - if (init_size & (init_size - 1)) + if (init_size && (init_size & (init_size - 1))) return NULL; ht = calloc(1, sizeof(struct cds_lfht)); ht->hash_fct = hash_fct; -- 2.34.1