--- sys/kern/kern_sig.c.orig
+++ sys/kern/kern_sig.c
@@ -4291,9 +4291,7 @@
 static void
 filt_sigdetach(struct knote *kn)
 {
-	struct proc *p = kn->kn_ptr.p_proc;
-
-	knlist_remove(p->p_klist, kn, 0);
+	knlist_remove(kn->kn_knlist, kn, 0);
 }
 
 /*
