No need to dereference struct proc to pids when comparing processes

for equality.

Reviewed by:	jhb, pho
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
This commit is contained in:
Konstantin Belousov 2015-10-20 20:12:42 +00:00
parent 238b89fcad
commit 1ed2e49b55

View File

@ -749,7 +749,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
case PT_ATTACH:
/* Self */
if (p->p_pid == td->td_proc->p_pid) {
if (p == td->td_proc) {
error = EINVAL;
goto fail;
}