git: 411c28b6caa4 - main - hash(9): fix my stupid off-by-one
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 12 Apr 2026 21:11:06 UTC
The branch main has been updated by glebius:
URL: https://cgit.FreeBSD.org/src/commit/?id=411c28b6caa4a55d89cc34d77b33141b78ced590
commit 411c28b6caa4a55d89cc34d77b33141b78ced590
Author: Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2026-04-12 21:10:27 +0000
Commit: Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2026-04-12 21:10:27 +0000
hash(9): fix my stupid off-by-one
Fixes: abf68d1cf02550c3c0341f5bb90be0d34f655a15
---
sys/kern/subr_hash.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/kern/subr_hash.c b/sys/kern/subr_hash.c
index a9dada7b4eb6..e74ad825966e 100644
--- a/sys/kern/subr_hash.c
+++ b/sys/kern/subr_hash.c
@@ -162,7 +162,7 @@ hashalloc(struct hashalloc_args *args)
size >>= 1;
break;
case HASH_TYPE_PRIME:
- for (i = nitems(primes); args->size < primes[i]; i--)
+ for (i = nitems(primes) - 1; args->size < primes[i]; i--)
;
size = primes[i];
break;