Skip to contentSkip to conversation

lib/librte_table: fix copy paste error in lru hash table

PATCH In review Jasvinder Singh 2 participants 2 messages Oct 27, 2017 – Nov 7, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/librte_table: fix copy paste error in lru hash table

Fixes the copy paste error in lru hash table parameters check.

Coverity issue: 198433

Fixes b5cde2cb8c81 ("table: rework variable size key lru hash table")
---
 lib/librte_table/rte_table_hash_lru.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
lib/librte_table/rte_table_hash_lru.c +2 -3
index 139b8fb..a07392f 100644
@@ -148,15 +148,14 @@ check_params_create(struct rte_table_hash_params *params)
 	}
 
 	/* n_keys */
-	if ((params->n_keys == 0) ||
-		(!rte_is_power_of_2(params->n_keys))) {
+	if (params->n_keys == 0) {
 		RTE_LOG(ERR, TABLE, "%s: n_keys invalid value\n", __func__);
 		return -EINVAL;
 	}
 
 	/* n_buckets */
 	if ((params->n_buckets == 0) ||
-		(!rte_is_power_of_2(params->n_keys))) {
+		(!rte_is_power_of_2(params->n_buckets))) {
 		RTE_LOG(ERR, TABLE, "%s: n_buckets invalid value\n", __func__);
 		return -EINVAL;
 	}
Signature · 1 line
2.9.3