Module Name: src Committed By: pgoyette Date: Thu Dec 14 11:45:40 UTC 2017
Modified Files: src/sys/kern: kern_module.c Log Message: When looking for a duplicate module name, also check the pending list. To generate a diff of this commit: cvs rdiff -u -r1.128 -r1.129 src/sys/kern/kern_module.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/kern_module.c diff -u src/sys/kern/kern_module.c:1.128 src/sys/kern/kern_module.c:1.129 --- src/sys/kern/kern_module.c:1.128 Thu Dec 14 10:39:32 2017 +++ src/sys/kern/kern_module.c Thu Dec 14 11:45:40 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_module.c,v 1.128 2017/12/14 10:39:32 martin Exp $ */ +/* $NetBSD: kern_module.c,v 1.129 2017/12/14 11:45:40 pgoyette Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.128 2017/12/14 10:39:32 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.129 2017/12/14 11:45:40 pgoyette Exp $"); #define _MODULE_INTERNAL @@ -1048,6 +1048,14 @@ module_do_load(const char *name, bool is if (mod->mod_source == MODULE_SOURCE_FILESYS) { mod2 = module_lookup(mod->mod_info->mi_name); if (mod2 == NULL) { + TAILQ_FOREACH(mod2, pending, mod_chain) { + if (strcmp(mod2->mod_info->mi_name, name) == 0) { + break; + } + } + } + + if (mod2 == NULL) { module_error("newly added module `%s'" " not found", mod->mod_info->mi_name); } else if (mod2 != mod) {