]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
virtio-net: fix the upper bound when trying to delete queues
authorJason Wang <jasowang@redhat.com>
Thu, 23 Apr 2015 06:21:34 +0000 (14:21 +0800)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 28 Jul 2015 23:22:35 +0000 (18:22 -0500)
Virtqueue were indexed from zero, so don't delete virtqueue whose
index is n->max_queues * 2 + 1.

Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: qemu-stable <qemu-stable@nongnu.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 27a46dcf5038e20451101ed2d5414aebf3846e27)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/net/virtio-net.c

index 59f76bcf7676700fff53f2647c4b8f0a94d72b63..b6fac9cc2ba35149b8be31d7e22d4327d0f7fcbf 100644 (file)
@@ -1309,7 +1309,7 @@ static void virtio_net_set_multiqueue(VirtIONet *n, int multiqueue)
 
     n->multiqueue = multiqueue;
 
-    for (i = 2; i <= n->max_queues * 2 + 1; i++) {
+    for (i = 2; i < n->max_queues * 2 + 1; i++) {
         virtio_del_queue(vdev, i);
     }