git: 3692877a6cf8 - main - kern_procctl.c: use td->td_proc instead of curproc

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Tue, 19 Oct 2021 20:04:54 UTC
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=3692877a6cf8fc374349f3d9b2cbb190fec484a0

commit 3692877a6cf8fc374349f3d9b2cbb190fec484a0
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-10-18 21:07:25 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2021-10-19 20:04:34 +0000

    kern_procctl.c: use td->td_proc instead of curproc
    
    Suggested by:   markj
    Reviewed by:    emaste, markj
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D32513
---
 sys/kern/kern_procctl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c
index c3f078f96e80..890a2e05bb27 100644
--- a/sys/kern/kern_procctl.c
+++ b/sys/kern/kern_procctl.c
@@ -136,7 +136,7 @@ reap_acquire(struct thread *td, struct proc *p, void *data __unused)
 {
 
 	sx_assert(&proctree_lock, SX_XLOCKED);
-	if (p != curproc)
+	if (p != td->td_proc)
 		return (EPERM);
 	if ((p->p_treeflag & P_TREE_REAPER) != 0)
 		return (EBUSY);
@@ -153,7 +153,7 @@ reap_release(struct thread *td, struct proc *p, void *data __unused)
 {
 
 	sx_assert(&proctree_lock, SX_XLOCKED);
-	if (p != curproc)
+	if (p != td->td_proc)
 		return (EPERM);
 	if (p == initproc)
 		return (EINVAL);