summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2007-12-01 16:20:08 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2007-12-01 16:20:08 +0000
commitfde23a4633d2a8bdcdcf2ad448ba33a9b389ec04 (patch)
tree074f49bad838fe41cac1571720cb60240b384540 /sys/arch
parenta2d2310c3246bb3d8ca740c50f391e18ddce4efc (diff)
Don't be lazy in the locking in SYSCALL_DEBUG code.
KERNEL_PROC_UNLOCK is not safe for recursion (becuase it clears P_BIGLOCK) so we have to make that lock conditional as well. Found by tholo@ when reviewing the i386 diff.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/amd64/amd64/syscall.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/arch/amd64/amd64/syscall.c b/sys/arch/amd64/amd64/syscall.c
index c0031aee6d6..0d4f036bc5e 100644
--- a/sys/arch/amd64/amd64/syscall.c
+++ b/sys/arch/amd64/amd64/syscall.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: syscall.c,v 1.10 2007/11/27 18:09:37 art Exp $ */
+/* $OpenBSD: syscall.c,v 1.11 2007/12/01 16:20:07 art Exp $ */
/* $NetBSD: syscall.c,v 1.1 2003/04/26 18:39:32 fvdl Exp $ */
/*-
@@ -138,9 +138,11 @@ syscall(struct trapframe frame)
if (!nolock)
KERNEL_PROC_LOCK(p);
#ifdef SYSCALL_DEBUG
- KERNEL_PROC_LOCK(p);
+ if (nolock)
+ KERNEL_PROC_LOCK(p);
scdebug_call(p, code, argp);
- KERNEL_PROC_UNLOCK(p);
+ if (nolock)
+ KERNEL_PROC_UNLOCK(p);
#endif
#ifdef KTRACE
if (KTRPOINT(p, KTR_SYSCALL)) {