summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_linker.c
diff options
context:
space:
mode:
authorae <ae@FreeBSD.org>2012-03-21 09:48:32 +0000
committerae <ae@FreeBSD.org>2012-03-21 09:48:32 +0000
commitf0e7ec67c01a49bbc678aeaa3c6166e1112747ea (patch)
tree7d1566ba332ccbef9e26b53da563ce932a71c497 /sys/kern/kern_linker.c
parent7bb0bdde2aed9f58ebdd5abcb420f0ee56889988 (diff)
downloadFreeBSD-src-f0e7ec67c01a49bbc678aeaa3c6166e1112747ea.zip
FreeBSD-src-f0e7ec67c01a49bbc678aeaa3c6166e1112747ea.tar.gz
Acquire modules lock before call module_getname() in the KLD_DEBUG case.
MFC after: 1 week
Diffstat (limited to 'sys/kern/kern_linker.c')
-rw-r--r--sys/kern/kern_linker.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c
index 958225c..aba9d98 100644
--- a/sys/kern/kern_linker.c
+++ b/sys/kern/kern_linker.c
@@ -638,8 +638,12 @@ linker_file_unload(linker_file_t file, int flags)
* 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;
OpenPOWER on IntegriCloud