]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
Provide better debug message on kernel module name clash.
authortrasz <trasz@FreeBSD.org>
Sat, 10 Oct 2015 09:21:55 +0000 (09:21 +0000)
committertrasz <trasz@FreeBSD.org>
Sat, 10 Oct 2015 09:21:55 +0000 (09:21 +0000)
Reviewed by: kib@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

sys/kern/kern_module.c

index b7693203283ac139bc3114f12814636e560a2eb1..479345e43f74c6bb3e47129653a50281cb6407b2 100644 (file)
@@ -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);