From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39314) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJdkR-0001rO-Nu for qemu-devel@nongnu.org; Fri, 06 Feb 2015 02:54:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJdkI-0005Nn-Sn for qemu-devel@nongnu.org; Fri, 06 Feb 2015 02:54:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37793) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJdkI-0005Ng-LT for qemu-devel@nongnu.org; Fri, 06 Feb 2015 02:54:34 -0500 From: Jason Wang Date: Fri, 6 Feb 2015 15:54:11 +0800 Message-Id: <1423209253-22222-4-git-send-email-jasowang@redhat.com> In-Reply-To: <1423209253-22222-1-git-send-email-jasowang@redhat.com> References: <1423209253-22222-1-git-send-email-jasowang@redhat.com> Subject: [Qemu-devel] [PATCH 3/5] virtio-net: fix the upper bound when trying to delete queues List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Jason Wang , Anthony Liguori , mst@redhat.com Virtqueue were indexed from zero, so don't delete virtqueue whose index is n->max_queues * 2 + 1. Cc: Anthony Liguori Cc: Michael S. Tsirkin Signed-off-by: Jason Wang --- hw/net/virtio-net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 45da34a..184b2f2 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -1306,7 +1306,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); } -- 1.9.1