mirror of
https://github.com/opnsense/src.git
synced 2026-06-04 22:32:43 -04:00
kcmp_pget(): add an assert that we did not hold the current process
Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 3 days
This commit is contained in:
parent
11d79c4756
commit
1e01650a78
1 changed files with 5 additions and 1 deletions
|
|
@ -2092,11 +2092,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
|
||||
|
|
|
|||
Loading…
Reference in a new issue