From: kib Date: Tue, 20 Oct 2015 20:12:42 +0000 (+0000) Subject: No need to dereference struct proc to pids when comparing processes X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=f8f03021517d1601d80a92e9ddcc7c0103f9d912;p=people%2Fjulieng%2Ffreebsd.git 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 --- diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 8392c8376499..588b43c606fe 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -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; }