Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Oct 2015 09:21:56 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r289111 - head/sys/kern
Message-ID:  <201510100921.t9A9LucG029946@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Sat Oct 10 09:21:55 2015
New Revision: 289111
URL: https://svnweb.freebsd.org/changeset/base/289111

Log:
  Provide better debug message on kernel module name clash.
  
  Reviewed by:	kib@
  MFC after:	1 month
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/kern/kern_module.c

Modified: head/sys/kern/kern_module.c
==============================================================================
--- head/sys/kern/kern_module.c	Sat Oct 10 09:03:31 2015	(r289110)
+++ head/sys/kern/kern_module.c	Sat Oct 10 09:21:55 2015	(r289111)
@@ -158,16 +158,12 @@ module_register(const moduledata_t *data
 	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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510100921.t9A9LucG029946>