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
This commit is contained in:
pjd 2008-04-17 19:19:40 +00:00
parent 29daa50d47
commit 3e83d6e7db

View File

@ -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);
}