Fix dereference after NULL check.

CID:		1234607
Sponsored by:	Nginx, Inc.
This commit is contained in:
Gleb Smirnoff 2014-09-03 08:14:07 +00:00
parent fef8cac0c4
commit 5b5477d762

View File

@ -921,10 +921,11 @@ fill_kinfo_proc_only(struct proc *p, struct kinfo_proc *kp)
kp->ki_xstat = p->p_xstat;
kp->ki_acflag = p->p_acflag;
kp->ki_lock = p->p_lock;
if (p->p_pptr)
if (p->p_pptr) {
kp->ki_ppid = proc_realparent(p)->p_pid;
if (p->p_flag & P_TRACED)
kp->ki_tracer = p->p_pptr->p_pid;
if (p->p_flag & P_TRACED)
kp->ki_tracer = p->p_pptr->p_pid;
}
}
/*