summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2008-04-17 19:19:40 +0000
committerpjd <pjd@FreeBSD.org>2008-04-17 19:19:40 +0000
commit3e83d6e7db0e2c7d805fd36da3475e635fbb4b3e (patch)
treeb6fab77274e55a7956dceebcbf420888f5372a1c
parent29daa50d475a056ec6901b73e7befbdc90e2bb90 (diff)
downloadFreeBSD-src-3e83d6e7db0e2c7d805fd36da3475e635fbb4b3e.zip
FreeBSD-src-3e83d6e7db0e2c7d805fd36da3475e635fbb4b3e.tar.gz
Allow linker_search_symbol_name() to be called with KLD lock held.
The linker_search_symbol_name() function is used by stack_print() and stack_print() can be called from kernel module unload method. MFC after: 1 week
-rw-r--r--sys/kern/kern_linker.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c
index 45d7653..c417366 100644
--- a/sys/kern/kern_linker.c
+++ b/sys/kern/kern_linker.c
@@ -924,11 +924,14 @@ int
linker_search_symbol_name(caddr_t value, char *buf, u_int buflen,
long *offset)
{
- int error;
+ int error, locked;
- KLD_LOCK();
+ locked = KLD_LOCKED();
+ if (!locked)
+ KLD_LOCK();
error = linker_debug_search_symbol_name(value, buf, buflen, offset);
- KLD_UNLOCK();
+ if (!locked)
+ KLD_UNLOCK();
return (error);
}
OpenPOWER on IntegriCloud