kcmp_pget(): add an assert that we did not hold the current process

(cherry picked from commit 1e01650a78)
This commit is contained in:
Konstantin Belousov 2024-04-29 21:51:53 +03:00
parent eadd4eae92
commit 66e0bf7668

View file

@ -2094,11 +2094,15 @@ kcmp_cmp(uintptr_t a, uintptr_t b)
static int
kcmp_pget(struct thread *td, pid_t pid, struct proc **pp)
{
int error;
if (pid == td->td_proc->p_pid) {
*pp = td->td_proc;
return (0);
}
return (pget(pid, PGET_CANDEBUG | PGET_NOTWEXIT | PGET_HOLD, pp));
error = pget(pid, PGET_CANDEBUG | PGET_NOTWEXIT | PGET_HOLD, pp);
MPASS(*pp != td->td_proc);
return (error);
}
int