Module Name:    src
Committed By:   ad
Date:           Sun Feb 23 20:08:35 UTC 2020

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

Log Message:
shutdown_all: take kernel_lock now that kern_reboot() doesn't.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/kern/kern_pmf.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_pmf.c
diff -u src/sys/kern/kern_pmf.c:1.40 src/sys/kern/kern_pmf.c:1.41
--- src/sys/kern/kern_pmf.c:1.40	Sun Apr  8 11:46:13 2018
+++ src/sys/kern/kern_pmf.c	Sun Feb 23 20:08:35 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_pmf.c,v 1.40 2018/04/08 11:46:13 mlelstv Exp $ */
+/* $NetBSD: kern_pmf.c,v 1.41 2020/02/23 20:08:35 ad Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill <jmcne...@invisible.ca>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_pmf.c,v 1.40 2018/04/08 11:46:13 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_pmf.c,v 1.41 2020/02/23 20:08:35 ad Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -351,6 +351,7 @@ shutdown_all(int how)
 	device_t curdev;
 	bool progress = false;
 
+	KERNEL_LOCK(1, NULL);
 	for (curdev = shutdown_first(&s); curdev != NULL;
 	     curdev = shutdown_next(&s)) {
 		aprint_debug(" shutting down %s, ", device_xname(curdev));
@@ -369,6 +370,7 @@ shutdown_all(int how)
 			aprint_debug("success.");
 		}
 	}
+	KERNEL_UNLOCK_ONE(NULL);
 	return progress;
 }
 

Reply via email to