qemu:virtio-net: Check return size on the correct sg list
PATCH 1/1 qemu:virtio-net: Check return size on the correct sg list
When checking that the size of the control virtqueue return field is sufficient, use the correct sg list.
Signed-off-by Alex Williamson <[email protected]>
---
hw/virtio-net.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
hw/virtio-net.c +1 -1
@@ -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 ); }
Anthony Liguori
AppliedQuoted 5 lines · 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 <[email protected]>
Applied to stable and trunk. Thanks.
Regards,
Anthony Liguori
Quoted 23 lines
---
hw/virtio-net.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)hw/virtio-net.c +1
-1@@ -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 ); }