]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
No need to dereference struct proc to pids when comparing processes
authorkib <kib@FreeBSD.org>
Tue, 20 Oct 2015 20:12:42 +0000 (20:12 +0000)
committerkib <kib@FreeBSD.org>
Tue, 20 Oct 2015 20:12:42 +0000 (20:12 +0000)
for equality.

Reviewed by: jhb, pho
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

sys/kern/sys_process.c

index 8392c83764993852a15a9acc1eb1a99be2dfb94a..588b43c606fe3f83f504009b824182e1bc8f0927 100644 (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;
                }