aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Tomasz Napierala <trasz@FreeBSD.org>2015-10-10 09:21:55 +0000
committerEdward Tomasz Napierala <trasz@FreeBSD.org>2015-10-10 09:21:55 +0000
commitb9a5c7b5954aac92d0b0508bc21b4ccc9a8ebd92 (patch)
tree9f2728c75a29e82e94a1729f1e27b509d03f4cac
parent45d7de1d37b95e780668c0380603ec69d1e49cf1 (diff)
downloadsrc-b9a5c7b5954aac92d0b0508bc21b4ccc9a8ebd92.tar.gz
src-b9a5c7b5954aac92d0b0508bc21b4ccc9a8ebd92.zip
Provide better debug message on kernel module name clash.
Reviewed by: kib@ MFC after: 1 month Sponsored by: The FreeBSD Foundation
Notes
Notes: svn path=/head/; revision=289111
-rw-r--r--sys/kern/kern_module.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/kern/kern_module.c b/sys/kern/kern_module.c
index b7693203283a..479345e43f74 100644
--- a/sys/kern/kern_module.c
+++ b/sys/kern/kern_module.c
@@ -158,16 +158,12 @@ module_register(const moduledata_t *data, linker_file_t container)
newmod = module_lookupbyname(data->name);
if (newmod != NULL) {
MOD_XUNLOCK;
- printf("module_register: module %s already exists!\n",
- data->name);
+ printf("%s: cannot register %s from %s; already loaded from %s\n",
+ __func__, data->name, container->filename, newmod->file->filename);
return (EEXIST);
}
namelen = strlen(data->name) + 1;
newmod = malloc(sizeof(struct module) + namelen, M_MODULE, M_WAITOK);
- if (newmod == NULL) {
- MOD_XUNLOCK;
- return (ENOMEM);
- }
newmod->refs = 1;
newmod->id = nextid++;
newmod->name = (char *)(newmod + 1);