summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2014-11-20 11:29:43 +0000
committerkib <kib@FreeBSD.org>2014-11-20 11:29:43 +0000
commit0682b47671d3100f825450e22bff4db3d1ff134d (patch)
treecf3947f8921d8d50fff2c94e050a3c3b1d678082 /sys/kern
parent941dc2c8238d8c6239ecf27e140fc79f9394ea09 (diff)
downloadFreeBSD-src-0682b47671d3100f825450e22bff4db3d1ff134d.zip
FreeBSD-src-0682b47671d3100f825450e22bff4db3d1ff134d.tar.gz
MFC r274474:
Do not try to dereference thread pointer when the value is not a pointer.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_lock.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c
index f221569..3655389 100644
--- a/sys/kern/kern_lock.c
+++ b/sys/kern/kern_lock.c
@@ -1341,9 +1341,14 @@ lockmgr_printinfo(const struct lock *lk)
(uintmax_t)LK_SHARERS(lk->lk_lock));
else {
td = lockmgr_xholder(lk);
- printf("lock type %s: EXCL by thread %p "
- "(pid %d, %s, tid %d)\n", lk->lock_object.lo_name, td,
- td->td_proc->p_pid, td->td_proc->p_comm, td->td_tid);
+ if (td == (struct thread *)LK_KERNPROC)
+ printf("lock type %s: EXCL by KERNPROC\n",
+ lk->lock_object.lo_name);
+ else
+ printf("lock type %s: EXCL by thread %p "
+ "(pid %d, %s, tid %d)\n", lk->lock_object.lo_name,
+ td, td->td_proc->p_pid, td->td_proc->p_comm,
+ td->td_tid);
}
x = lk->lk_lock;
OpenPOWER on IntegriCloud