--- sys/kern/kern_thr.c.orig
+++ sys/kern/kern_thr.c
@@ -506,7 +506,7 @@
 		p = ttd->td_proc;
 		AUDIT_ARG_PROCESS(p);
 		error = p_cansignal(td, p, uap->sig);
-		if (uap->sig == 0)
+		if (error != 0 || uap->sig == 0)
 			;
 		else if (!_SIG_VALID(uap->sig))
 			error = EINVAL;
