Commit c6bb9a32cb97214b2ee0845858c27c24c8da61da
1 parent
3450df30
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
Showing
1 changed file
with
1 additions
and
1 deletions
hw/virtio-net.c
... | ... | @@ -228,7 +228,7 @@ static void virtio_net_handle_ctrl(VirtIODevice *vdev, VirtQueue *vq) |
228 | 228 | } |
229 | 229 | |
230 | 230 | if (elem.out_sg[0].iov_len < sizeof(ctrl) || |
231 | - elem.out_sg[elem.in_num - 1].iov_len < sizeof(status)) { | |
231 | + elem.in_sg[elem.in_num - 1].iov_len < sizeof(status)) { | |
232 | 232 | fprintf(stderr, "virtio-net ctrl header not in correct element\n"); |
233 | 233 | exit(1); |
234 | 234 | } | ... | ... |