svn commit: r233276 - head/sys/kern

Andrey V. Elsukov ae at FreeBSD.org
Wed Mar 21 09:48:34 UTC 2012


Author: ae
Date: Wed Mar 21 09:48:32 2012
New Revision: 233276
URL: http://svn.freebsd.org/changeset/base/233276

Log:
  Acquire modules lock before call module_getname() in the KLD_DEBUG case.
  
  MFC after:	1 week

Modified:
  head/sys/kern/kern_linker.c

Modified: head/sys/kern/kern_linker.c
==============================================================================
--- head/sys/kern/kern_linker.c	Wed Mar 21 09:19:23 2012	(r233275)
+++ head/sys/kern/kern_linker.c	Wed Mar 21 09:48:32 2012	(r233276)
@@ -638,8 +638,12 @@ linker_file_unload(linker_file_t file, i
 		 * Give the module a chance to veto the unload.
 		 */
 		if ((error = module_unload(mod)) != 0) {
+#ifdef KLD_DEBUG
+			MOD_SLOCK;
 			KLD_DPF(FILE, ("linker_file_unload: module %s"
 			    " failed unload\n", module_getname(mod)));
+			MOD_SUNLOCK;
+#endif
 			return (error);
 		}
 		MOD_XLOCK;


More information about the svn-src-head mailing list