summaryrefslogtreecommitdiff
path: root/sys/kern/kern_lock.c
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2002-07-12 14:03:13 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2002-07-12 14:03:13 +0000
commit8d1dff739991f00306ce22ead1944a347af0bdb2 (patch)
treeab8f3f0b54b6dc0cea0af98e84a9d446bee40073 /sys/kern/kern_lock.c
parentfc0c3858775ac2805ca1e604eac6b1c34c8f1126 (diff)
Detect the case where we LK_RELEASE a lock when noone is holding it.
Diffstat (limited to 'sys/kern/kern_lock.c')
-rw-r--r--sys/kern/kern_lock.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c
index b35d8f25c23..b9b12083941 100644
--- a/sys/kern/kern_lock.c
+++ b/sys/kern/kern_lock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_lock.c,v 1.13 2002/03/17 18:26:51 art Exp $ */
+/* $OpenBSD: kern_lock.c,v 1.14 2002/07/12 14:03:12 art Exp $ */
/*
* Copyright (c) 1995
@@ -384,7 +384,8 @@ lockmgr(lkp, flags, interlkp, p)
} else if (lkp->lk_sharecount != 0) {
lkp->lk_sharecount--;
COUNT(p, -1);
- }
+ } else
+ panic("lockmgr: LK_RELEASE of unlocked lock");
if (lkp->lk_waitcount)
wakeup((void *)lkp);
break;