Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Jan 2016 19:59:56 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r293688 - stable/10/sys/kern
Message-ID:  <201601111959.u0BJxujQ075962@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Mon Jan 11 19:59:56 2016
New Revision: 293688
URL: https://svnweb.freebsd.org/changeset/base/293688

Log:
  MFC r289111:
  
  Provide better debug message on kernel module name clash.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  stable/10/sys/kern/kern_module.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/kern_module.c
==============================================================================
--- stable/10/sys/kern/kern_module.c	Mon Jan 11 19:36:44 2016	(r293687)
+++ stable/10/sys/kern/kern_module.c	Mon Jan 11 19:59:56 2016	(r293688)
@@ -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?201601111959.u0BJxujQ075962>