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
This commit is contained in:
Konstantin Belousov 2021-10-19 00:07:25 +03:00
parent f5bb6e5a6d
commit 3692877a6c

View File

@ -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);