Skip to content
Commit a626117f authored by Michael S. Tsirkin's avatar Michael S. Tsirkin Committed by Michael Roth
Browse files

virtio: fix up max size checks



Coverity reports that ARRAY_SIZE(elem->out_sg) (and all the others too)
is wrong because elem->out_sg is a pointer.

However, the check is not in the right place and the max_size argument
of virtqueue_map_iovec can be removed.  The check on in_num/out_num
should be moved to qemu_get_virtqueue_element instead, before the call
to virtqueue_alloc_element.

Cc: qemu-stable@nongnu.org
Reported-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Fixes: 3724650d ("virtio: introduce virtqueue_alloc_element")
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Reviewed-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
(cherry picked from commit 6bdc21c0)
* dropped context dep on 8607f5c3
Signed-off-by: default avatarMichael Roth <mdroth@linux.vnet.ibm.com>
parent 3b33cba6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment