Module Name:    src
Committed By:   chs
Date:           Tue Nov 13 14:08:08 UTC 2012

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

Log Message:
in pmf_system_shutdown(), don't do anything if we're panicing.
this prevents a hang trying to shut down other CPUs on x86,
and in general we could be called in any context from a panic
so it's best to skip unnecessary operations in that case.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 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.35 src/sys/kern/kern_pmf.c:1.36
--- src/sys/kern/kern_pmf.c:1.35	Sun Jun  5 09:04:22 2011
+++ src/sys/kern/kern_pmf.c	Tue Nov 13 14:08:07 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_pmf.c,v 1.35 2011/06/05 09:04:22 dsl Exp $ */
+/* $NetBSD: kern_pmf.c,v 1.36 2012/11/13 14:08:07 chs 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.35 2011/06/05 09:04:22 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_pmf.c,v 1.36 2012/11/13 14:08:07 chs Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -381,6 +381,10 @@ shutdown_all(int how)
 void
 pmf_system_shutdown(int how)
 {
+
+	if (panicstr != NULL)
+		return;
+
 	aprint_debug("Shutting down devices:");
 	shutdown_all(how);
 }

Reply via email to