Initialize ki to p->p_aioinfo after we know it's going to be referencing

a valid kaioinfo structure. This avoids a potential NULL pointer dereference.

Found with:	Coverity Prevent(tm)
MFC after:	2 weeks
This commit is contained in:
Christian S.J. Peron 2006-01-15 01:55:45 +00:00
parent 2166476ae9
commit 8213baf002

View File

@ -2318,9 +2318,9 @@ aio_waitcomplete(struct thread *td, struct aio_waitcomplete_args *uap)
timo = tvtohz(&atv);
}
ki = p->p_aioinfo;
if (ki == NULL)
if (p->p_aioinfo == NULL)
aio_init_aioinfo(p);
ki = p->p_aioinfo;
for (;;) {
PROC_LOCK(p);