From 9491714e289b601fc96f353a1f3db33ffdf5c65a Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Mon, 1 Mar 2021 12:16:34 +0100 Subject: [PATCH] infra: safeguard hash_fn --- kernel/sy_old/sy_generic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sy_old/sy_generic.c b/kernel/sy_old/sy_generic.c index fec3e995..f136e0b9 100644 --- a/kernel/sy_old/sy_generic.c +++ b/kernel/sy_old/sy_generic.c @@ -1716,10 +1716,10 @@ void _mars_order(struct mars_cookie *cookie, struct mars_dent *dent) for (;;) { struct list_head *hash_try; struct list_head *hash_try_anchor; - int hash_try_index = test->d_hash; + unsigned int hash_try_index = test->d_hash; #ifdef CONFIG_MARS_DEBUG - if (unlikely(hash_try_index < 0 || hash_try_index >= MARS_GLOBAL_HASH)) { + if (unlikely(hash_try_index >= MARS_GLOBAL_HASH)) { MARS_ERR("bad hash index %d\n", hash_try_index); break; }