Module Name:    src
Committed By:   riastradh
Date:           Sun Apr 16 11:18:25 UTC 2023

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

Log Message:
autoconf(9): Assert alldevs_lock held in config_unit_nextfree.

The one caller, config_unit_alloc, guarantees it through
config_alldevs_enter/exit.


To generate a diff of this commit:
cvs rdiff -u -r1.308 -r1.309 src/sys/kern/subr_autoconf.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/subr_autoconf.c
diff -u src/sys/kern/subr_autoconf.c:1.308 src/sys/kern/subr_autoconf.c:1.309
--- src/sys/kern/subr_autoconf.c:1.308	Sun Apr 16 11:14:58 2023
+++ src/sys/kern/subr_autoconf.c	Sun Apr 16 11:18:25 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_autoconf.c,v 1.308 2023/04/16 11:14:58 riastradh Exp $ */
+/* $NetBSD: subr_autoconf.c,v 1.309 2023/04/16 11:18:25 riastradh Exp $ */
 
 /*
  * Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.308 2023/04/16 11:14:58 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.309 2023/04/16 11:18:25 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -1483,6 +1483,8 @@ config_unit_nextfree(cfdriver_t cd, cfda
 {
 	int unit = cf->cf_unit;
 
+	KASSERT(mutex_owned(&alldevs_lock));
+
 	if (unit < 0)
 		return -1;
 	if (cf->cf_fstate == FSTATE_STAR) {

Reply via email to