diff options
author | Christian S.J. Peron <csjp@FreeBSD.org> | 2006-01-15 01:55:45 +0000 |
---|---|---|
committer | Christian S.J. Peron <csjp@FreeBSD.org> | 2006-01-15 01:55:45 +0000 |
commit | 8213baf00241dd8238ef3d9be5b423d69949ca38 (patch) | |
tree | 79902c724680df272cbb2333879c135635787714 /sys/kern/vfs_aio.c | |
parent | 2166476ae9ef62b4d0ee2f0d4a62052adde460b0 (diff) | |
download | src-8213baf00241dd8238ef3d9be5b423d69949ca38.tar.gz src-8213baf00241dd8238ef3d9be5b423d69949ca38.zip |
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
Notes
Notes:
svn path=/head/; revision=154389
Diffstat (limited to 'sys/kern/vfs_aio.c')
-rw-r--r-- | sys/kern/vfs_aio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index 5466959c03bc..22a3bb78c5d5 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -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); |