mirror of https://gitee.com/openkylin/qemu.git
qemu:virtio-net: Check return size on the correct sg list (Alex Williamson)
When checking that the size of the control virtqueue return field is sufficient, use the correct sg list. Signed-off-by: Alex Williamson <alex.williamson@hp.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6845 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
3450df304d
commit
c6bb9a32cb
|
@ -228,7 +228,7 @@ static void virtio_net_handle_ctrl(VirtIODevice *vdev, VirtQueue *vq)
|
|||
}
|
||||
|
||||
if (elem.out_sg[0].iov_len < sizeof(ctrl) ||
|
||||
elem.out_sg[elem.in_num - 1].iov_len < sizeof(status)) {
|
||||
elem.in_sg[elem.in_num - 1].iov_len < sizeof(status)) {
|
||||
fprintf(stderr, "virtio-net ctrl header not in correct element\n");
|
||||
exit(1);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue