summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_witness.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2002-11-11 16:36:20 +0000
committerjhb <jhb@FreeBSD.org>2002-11-11 16:36:20 +0000
commit2dfe09331e47d4604cdc60a93d363666a499473d (patch)
tree465946127c6ff20f9790374ede03e74f337e0593 /sys/kern/subr_witness.c
parent873c175b8f626b1bd48d84513d9fd2e76a1cea3b (diff)
downloadFreeBSD-src-2dfe09331e47d4604cdc60a93d363666a499473d.zip
FreeBSD-src-2dfe09331e47d4604cdc60a93d363666a499473d.tar.gz
Correct an assertion in the code to traverse the list of locks to find an
earlier acquired lock with the same witness as the lock currently being acquired. If we had released several earlier acquired locks after acquiring enough locks to require another lock_list_entry bucket in the lock list, then subsequent lock_list_entry buckets could contain only one lock instance in which case i would be zero. Reported by: Joel M. Baldwin <qumqats@outel.org>
Diffstat (limited to 'sys/kern/subr_witness.c')
-rw-r--r--sys/kern/subr_witness.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c
index 8766bb9..411703a 100644
--- a/sys/kern/subr_witness.c
+++ b/sys/kern/subr_witness.c
@@ -666,7 +666,7 @@ witness_lock(struct lock_object *lock, int flags, const char *file, int line)
if (i == 0 && lle->ll_next != NULL) {
lle = lle->ll_next;
i = lle->ll_count - 1;
- MPASS(i != 0);
+ MPASS(i >= 0 && i < LOCK_NCHILDREN);
}
} while (i >= 0);
if (i < 0) {
OpenPOWER on IntegriCloud