proc_realparent(): assert that an orphaned child has real parent != parent

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D58504
This commit is contained in:
Konstantin Belousov committed 2026-07-28 22:45:47 +03:00
1 parent ce6ab51fc3
commit 8cef3c9b76
1 file changed
+3
+3
View File
@@ -124,6 +124,9 @@ proc_realparent(struct proc *child)
}
parent = __containerof(p->p_orphan.le_prev, struct proc,
p_orphans.lh_first);
KASSERT(child->p_pptr != parent,
("proc %d %p orphaned but parent %d %p is realparent",
child->p_pid, child, parent->p_pid, parent));
return (parent);
}