aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Popov <bp@FreeBSD.org>2001-04-10 00:56:19 +0000
committerBoris Popov <bp@FreeBSD.org>2001-04-10 00:56:19 +0000
commit16162e5789e76436e1e2d4991006af4d43ac7e57 (patch)
tree97c6e48f29e147a4204d7f5832d83e9e3c70bebd
parentd53d22496f3467c978131489ac9d53ab9314cc62 (diff)
Notes
-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 aaefb2ee5e98..06ee342f93ed 100644
--- a/sys/kern/subr_witness.c
+++ b/sys/kern/subr_witness.c
@@ -778,8 +778,10 @@ enroll(const char *description, struct lock_class *lock_class)
* This isn't quite right, as witness_cold is still 0 while we
* enroll all the locks initialized before witness_initialize().
*/
- if ((lock_class->lc_flags & LC_SPINLOCK) && !witness_cold)
+ if ((lock_class->lc_flags & LC_SPINLOCK) && !witness_cold) {
+ mtx_unlock_spin(&w_mtx);
panic("spin lock %s not in order list", description);
+ }
if ((w = witness_get()) == NULL)
return (NULL);
w->w_name = description;
@@ -790,9 +792,11 @@ enroll(const char *description, struct lock_class *lock_class)
STAILQ_INSERT_HEAD(&w_spin, w, w_typelist);
else if (lock_class->lc_flags & LC_SLEEPLOCK)
STAILQ_INSERT_HEAD(&w_sleep, w, w_typelist);
- else
+ else {
+ mtx_unlock_spin(&w_mtx);
panic("lock class %s is not sleep or spin",
lock_class->lc_name);
+ }
mtx_unlock_spin(&w_mtx);
return (w);