svn commit: r199758 - projects/mips/sys/kern
Warner Losh
imp at FreeBSD.org
Tue Nov 24 17:06:12 UTC 2009
Author: imp
Date: Tue Nov 24 17:06:11 2009
New Revision: 199758
URL: http://svn.freebsd.org/changeset/base/199758
Log:
Only all critical_enter()/critical_exit() if curthread has been set.
Otherwise we dereference a null pointer and can't get useful panic
info early in boot.
Modified:
projects/mips/sys/kern/kern_shutdown.c
Modified: projects/mips/sys/kern/kern_shutdown.c
==============================================================================
--- projects/mips/sys/kern/kern_shutdown.c Tue Nov 24 16:57:35 2009 (r199757)
+++ projects/mips/sys/kern/kern_shutdown.c Tue Nov 24 17:06:11 2009 (r199758)
@@ -516,7 +516,8 @@ panic(const char *fmt, ...)
va_list ap;
static char buf[256];
- critical_enter();
+ if (td)
+ critical_enter();
#ifdef SMP
/*
* We don't want multiple CPU's to panic at the same time, so we
@@ -575,7 +576,8 @@ panic(const char *fmt, ...)
/* thread_unlock(td); */
if (!sync_on_panic)
bootopt |= RB_NOSYNC;
- critical_exit();
+ if (td)
+ critical_exit();
boot(bootopt);
}
More information about the svn-src-projects
mailing list