Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Change a KASSERTMSG into a regular module_error - n...



details:   https://anonhg.NetBSD.org/src/rev/767a4164dc06
branches:  trunk
changeset: 358148:767a4164dc06
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Dec 14 10:39:32 2017 +0000

description:
Change a KASSERTMSG into a regular module_error - not nice for the kernel
to panic when I try to modload the 'ntfs' module.

diffstat:

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

diffs (31 lines):

diff -r 613a3c617e13 -r 767a4164dc06 sys/kern/kern_module.c
--- a/sys/kern/kern_module.c    Thu Dec 14 10:34:06 2017 +0000
+++ b/sys/kern/kern_module.c    Thu Dec 14 10:39:32 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_module.c,v 1.127 2017/12/11 22:00:26 pgoyette Exp $       */
+/*     $NetBSD: kern_module.c,v 1.128 2017/12/14 10:39:32 martin 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.127 2017/12/11 22:00:26 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.128 2017/12/14 10:39:32 martin Exp $");
 
 #define _MODULE_INTERNAL
 
@@ -1047,8 +1047,10 @@
         */
        if (mod->mod_source == MODULE_SOURCE_FILESYS) {
                mod2 = module_lookup(mod->mod_info->mi_name);
-               KASSERTMSG(mod2, "Newly added module not found!");
-               if (mod2 != mod) {
+               if (mod2 == NULL) {
+                       module_error("newly added module `%s'"
+                           " not found", mod->mod_info->mi_name);
+               } else if (mod2 != mod) {
                        module_error("module with name `%s' already loaded",
                            mod2->mod_info->mi_name);
                        error = EEXIST;



Home | Main Index | Thread Index | Old Index