From 1ed2e49b558e8229ef75b83204cce54bcd1a2bd0 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Tue, 20 Oct 2015 20:12:42 +0000 Subject: [PATCH] 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 --- sys/kern/sys_process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 8392c837649..588b43c606f 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; }