From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LhWwe-0000nd-NZ for qemu-devel@nongnu.org; Wed, 11 Mar 2009 18:30:36 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LhWwd-0000mt-VP for qemu-devel@nongnu.org; Wed, 11 Mar 2009 18:30:36 -0400 Received: from [199.232.76.173] (port=50929 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LhWwd-0000ml-OE for qemu-devel@nongnu.org; Wed, 11 Mar 2009 18:30:35 -0400 Received: from g4t0015.houston.hp.com ([15.201.24.18]:46320) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LhWwd-0008Gd-Fe for qemu-devel@nongnu.org; Wed, 11 Mar 2009 18:30:35 -0400 Received: from g5t0029.atlanta.hp.com (g5t0029.atlanta.hp.com [16.228.8.141]) by g4t0015.houston.hp.com (Postfix) with ESMTP id EF0BC824A for ; Wed, 11 Mar 2009 22:30:32 +0000 (UTC) From: Alex Williamson Date: Wed, 11 Mar 2009 16:27:31 -0600 Message-ID: <20090311222657.11804.44816.stgit@kvm.aw> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] qemu:virtio-net: Check return size on the correct sg list Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: alex.williamson@hp.com When checking that the size of the control virtqueue return field is sufficient, use the correct sg list. Signed-off-by: Alex Williamson --- hw/virtio-net.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/virtio-net.c b/hw/virtio-net.c index e83d101..ad55bb7 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); }