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:Paolo Bonzini <pbonzini@redhat.com> Fixes: 3724650d ("virtio: introduce virtqueue_alloc_element") Signed-off-by:
Michael S. Tsirkin <mst@redhat.com> Reviewed-by:
Cornelia Huck <cornelia.huck@de.ibm.com> (cherry picked from commit 6bdc21c0) * dropped context dep on 8607f5c3 Signed-off-by:
Michael Roth <mdroth@linux.vnet.ibm.com>
Loading
Please register or sign in to comment