Module Name: src
Committed By: martin
Date: Thu Dec 14 10:39:32 UTC 2017
Modified Files:
src/sys/kern: kern_module.c
Log Message:
Change a KASSERTMSG into a regular module_error - not nice for the kernel
to panic when I try to modload the 'ntfs' module.
To generate a diff of this commit:
cvs rdiff -u -r1.127 -r1.128 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.127 src/sys/kern/kern_module.c:1.128
--- src/sys/kern/kern_module.c:1.127 Mon Dec 11 22:00:26 2017
+++ src/sys/kern/kern_module.c Thu Dec 14 10:39:32 2017
@@ -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 @@ module_do_load(const char *name, bool is
*/
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;