Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Nov 2009 17:06:12 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r199758 - projects/mips/sys/kern
Message-ID:  <200911241706.nAOH6CRn024562@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200911241706.nAOH6CRn024562>