Do not leak process lock when current thread is not allowed to see target.

Bumped into by:	ed
MFC after:	3 days
This commit is contained in:
Konstantin Belousov 2010-02-14 13:59:01 +00:00
parent 75fb535394
commit d07dc8e3eb

View File

@ -349,8 +349,10 @@ filt_procattach(struct knote *kn)
if (p == NULL)
return (ESRCH);
if ((error = p_cansee(curthread, p)))
if ((error = p_cansee(curthread, p))) {
PROC_UNLOCK(p);
return (error);
}
kn->kn_ptr.p_proc = p;
kn->kn_flags |= EV_CLEAR; /* automatically set */