Provide better debug message on kernel module name clash.

Reviewed by:	kib@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Edward Tomasz Napierala 2015-10-10 09:21:55 +00:00
parent 45d7de1d37
commit b9a5c7b595
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=289111

View 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);