Module Name:    src
Committed By:   riastradh
Date:           Tue Aug 16 21:23:37 UTC 2022

Modified Files:
        src/sys/kern: kern_lock.c

Log Message:
KERNEL_LOCK(9): Fix previous for non-LOCKDEBUG builds.


To generate a diff of this commit:
cvs rdiff -u -r1.176 -r1.177 src/sys/kern/kern_lock.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/kern_lock.c
diff -u src/sys/kern/kern_lock.c:1.176 src/sys/kern/kern_lock.c:1.177
--- src/sys/kern/kern_lock.c:1.176	Tue Aug 16 18:13:09 2022
+++ src/sys/kern/kern_lock.c	Tue Aug 16 21:23:37 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_lock.c,v 1.176 2022/08/16 18:13:09 riastradh Exp $	*/
+/*	$NetBSD: kern_lock.c,v 1.177 2022/08/16 21:23:37 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008, 2009, 2020 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.176 2022/08/16 18:13:09 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.177 2022/08/16 21:23:37 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_lockdebug.h"
@@ -216,7 +216,9 @@ _kernel_lock(int nlocks)
 	    0);
 
 	if (__predict_true(__cpu_simple_lock_try(kernel_lock))) {
+#ifdef LOCKDEBUG
 		kernel_lock_holder = curcpu();
+#endif
 		ci->ci_biglock_count = nlocks;
 		l->l_blcnt = nlocks;
 		LOCKDEBUG_LOCKED(kernel_lock_dodebug, kernel_lock, NULL,

Reply via email to