Tue Sep 29 22:40:15 2009 UTC ()
#include "drvctl.h" for the NDRVCTL definition.  Without the NDRVCTL
definition, drvctl_init() is not called, the drvctl_eventq is not
initialized, and the kernel will panic in devmon_insert() when a
device is detached.

Thanks to Jared McNeill for pointing out the panic.


(dyoung)
diff -r1.401 -r1.402 src/sys/kern/init_main.c

cvs diff -r1.401 -r1.402 src/sys/kern/init_main.c (expand / switch to unified diff)

--- src/sys/kern/init_main.c 2009/09/21 12:14:46 1.401
+++ src/sys/kern/init_main.c 2009/09/29 22:40:15 1.402
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: init_main.c,v 1.401 2009/09/21 12:14:46 pooka Exp $ */ 1/* $NetBSD: init_main.c,v 1.402 2009/09/29 22:40:15 dyoung Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. 4 * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -87,42 +87,43 @@ @@ -87,42 +87,43 @@
87 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 87 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
88 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 88 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
89 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 89 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
90 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 90 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
91 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 91 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
92 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 92 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
93 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 93 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
94 * SUCH DAMAGE. 94 * SUCH DAMAGE.
95 * 95 *
96 * @(#)init_main.c 8.16 (Berkeley) 5/14/95 96 * @(#)init_main.c 8.16 (Berkeley) 5/14/95
97 */ 97 */
98 98
99#include <sys/cdefs.h> 99#include <sys/cdefs.h>
100__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.401 2009/09/21 12:14:46 pooka Exp $"); 100__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.402 2009/09/29 22:40:15 dyoung Exp $");
101 101
102#include "opt_ddb.h" 102#include "opt_ddb.h"
103#include "opt_ipsec.h" 103#include "opt_ipsec.h"
104#include "opt_modular.h" 104#include "opt_modular.h"
105#include "opt_ntp.h" 105#include "opt_ntp.h"
106#include "opt_pipe.h" 106#include "opt_pipe.h"
107#include "opt_sa.h" 107#include "opt_sa.h"
108#include "opt_syscall_debug.h" 108#include "opt_syscall_debug.h"
109#include "opt_sysv.h" 109#include "opt_sysv.h"
110#include "opt_fileassoc.h" 110#include "opt_fileassoc.h"
111#include "opt_ktrace.h" 111#include "opt_ktrace.h"
112#include "opt_pax.h" 112#include "opt_pax.h"
113#include "opt_compat_netbsd.h" 113#include "opt_compat_netbsd.h"
114#include "opt_wapbl.h" 114#include "opt_wapbl.h"
115 115
 116#include "drvctl.h"
116#include "ksyms.h" 117#include "ksyms.h"
117#include "rnd.h" 118#include "rnd.h"
118#include "sysmon_envsys.h" 119#include "sysmon_envsys.h"
119#include "sysmon_power.h" 120#include "sysmon_power.h"
120#include "sysmon_taskq.h" 121#include "sysmon_taskq.h"
121#include "sysmon_wdog.h" 122#include "sysmon_wdog.h"
122#include "veriexec.h" 123#include "veriexec.h"
123 124
124#include <sys/param.h> 125#include <sys/param.h>
125#include <sys/acct.h> 126#include <sys/acct.h>
126#include <sys/filedesc.h> 127#include <sys/filedesc.h>
127#include <sys/file.h> 128#include <sys/file.h>
128#include <sys/errno.h> 129#include <sys/errno.h>