Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern When looking for a duplicate module name, also chec...



details:   https://anonhg.NetBSD.org/src/rev/ddb67019c0cb
branches:  trunk
changeset: 828451:ddb67019c0cb
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Thu Dec 14 11:45:40 2017 +0000

description:
When looking for a duplicate module name, also check the pending list.

diffstat:

 sys/kern/kern_module.c |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (33 lines):

diff -r b7b926cddb0f -r ddb67019c0cb sys/kern/kern_module.c
--- a/sys/kern/kern_module.c    Thu Dec 14 11:39:31 2017 +0000
+++ b/sys/kern/kern_module.c    Thu Dec 14 11:45:40 2017 +0000
@@ -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 @@
        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) {



Home | Main Index | Thread Index | Old Index