diff --git a/sys/kern/kern_subr.c b/sys/kern/kern_subr.c index 550bc36c6b61..72ca247f8e7f 100644 --- a/sys/kern/kern_subr.c +++ b/sys/kern/kern_subr.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_subr.c,v 1.175 2008/01/15 14:26:42 ad Exp $ */ +/* $NetBSD: kern_subr.c,v 1.176 2008/01/18 01:22:18 joerg Exp $ */ /*- * Copyright (c) 1997, 1998, 1999, 2002, 2007, 2006 The NetBSD Foundation, Inc. @@ -86,7 +86,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_subr.c,v 1.175 2008/01/15 14:26:42 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_subr.c,v 1.176 2008/01/18 01:22:18 joerg Exp $"); #include "opt_ddb.h" #include "opt_md.h" @@ -476,6 +476,14 @@ doshutdownhooks(void) { struct hook_desc *dp; + if (panicstr != NULL) { + /* + * Do as few things as possible after a panic. + * We don't know the state the system is in. + */ + return; + } + while ((dp = LIST_FIRST(&shutdownhook_list)) != NULL) { LIST_REMOVE(dp, hk_list); (*dp->hk_fn)(dp->hk_arg);