From patchwork Thu Apr 23 06:21:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Wang X-Patchwork-Id: 463883 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 905BA1400B7 for ; Thu, 23 Apr 2015 16:22:53 +1000 (AEST) Received: from localhost ([::1]:38238 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlAXD-0000Db-EG for incoming@patchwork.ozlabs.org; Thu, 23 Apr 2015 02:22:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57876) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlAWg-0007dQ-6W for qemu-devel@nongnu.org; Thu, 23 Apr 2015 02:22:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YlAWd-0001Yw-0F for qemu-devel@nongnu.org; Thu, 23 Apr 2015 02:22:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49677) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlAWc-0001Yo-RM; Thu, 23 Apr 2015 02:22:14 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 5B7D791C02; Thu, 23 Apr 2015 06:22:14 +0000 (UTC) Received: from jason-ThinkPad-T430s.redhat.com (vpn1-7-179.pek2.redhat.com [10.72.7.179]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t3N6M586032751; Thu, 23 Apr 2015 02:22:12 -0400 From: Jason Wang To: qemu-devel@nongnu.org Date: Thu, 23 Apr 2015 14:21:34 +0800 Message-Id: <1429770109-23873-2-git-send-email-jasowang@redhat.com> In-Reply-To: <1429770109-23873-1-git-send-email-jasowang@redhat.com> References: <1429770109-23873-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Jason Wang , qemu-stable , mst@redhat.com Subject: [Qemu-devel] [PATCH V7 01/16] virtio-net: fix the upper bound when trying to delete queues X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Virtqueue were indexed from zero, so don't delete virtqueue whose index is n->max_queues * 2 + 1. Cc: Michael S. Tsirkin Cc: qemu-stable 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 59f76bc..b6fac9c 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -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); }