summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2001-11-15 19:46:36 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2001-11-15 19:46:36 +0000
commitf4076cc15821767e9fd5325af59ce9849f3ae86c (patch)
treed0d201898c5c71e88792fc72d8831909e87a9cc0 /sys/kern
parent101823b1a19a028df9b8ff1697bfb35d17899ac8 (diff)
Notes
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/subr_witness.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c
index a9b186463485..b91f7a2a8bd6 100644
--- a/sys/kern/subr_witness.c
+++ b/sys/kern/subr_witness.c
@@ -1419,9 +1419,11 @@ witness_assert(struct lock_object *lock, int flags, const char *file, int line)
instance = find_instance(curthread->td_sleeplocks, lock);
else if ((lock->lo_class->lc_flags & LC_SPINLOCK) != 0)
instance = find_instance(PCPU_GET(spinlocks), lock);
- else
+ else {
panic("Lock (%s) %s is not sleep or spin!",
lock->lo_class->lc_name, lock->lo_name);
+ return;
+ }
switch (flags) {
case LA_UNLOCKED:
if (instance != NULL)
@@ -1437,9 +1439,11 @@ witness_assert(struct lock_object *lock, int flags, const char *file, int line)
case LA_XLOCKED:
case LA_XLOCKED | LA_RECURSED:
case LA_XLOCKED | LA_NOTRECURSED:
- if (instance == NULL)
+ if (instance == NULL) {
panic("Lock (%s) %s not locked @ %s:%d.",
lock->lo_class->lc_name, lock->lo_name, file, line);
+ break;
+ }
if ((flags & LA_XLOCKED) != 0 &&
(instance->li_flags & LI_EXCLUSIVE) == 0)
panic("Lock (%s) %s not exclusively locked @ %s:%d.",