summaryrefslogtreecommitdiff
path: root/hw/virtio-net.c
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-03-13 15:04:02 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-03-13 15:04:02 +0000
commitdebb11feaf730614158b3ec43a5680b582405dd0 (patch)
tree4e3020f169ab1b6d21164455df886ed582eb1e94 /hw/virtio-net.c
parent831d72f97b06aa10ab261a4637d89afcc3ed17ba (diff)
downloadqemu-debb11feaf730614158b3ec43a5680b582405dd0.tar.gz
qemu-debb11feaf730614158b3ec43a5680b582405dd0.tar.bz2
qemu-debb11feaf730614158b3ec43a5680b582405dd0.zip
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
Diffstat (limited to 'hw/virtio-net.c')
-rw-r--r--hw/virtio-net.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/virtio-net.c b/hw/virtio-net.c
index e83d1019c1..ad55bb7610 100644
--- a/hw/virtio-net.c
+++ b/hw/virtio-net.c
@@ -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);
}