From patchwork Thu Feb 21 09:59:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 222245 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0E22E2C0087 for ; Thu, 21 Feb 2013 22:00:05 +1100 (EST) Received: from localhost ([::1]:43502 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8Sx3-0005E8-Hk for incoming@patchwork.ozlabs.org; Thu, 21 Feb 2013 05:00:29 -0500 Received: from eggs.gnu.org ([208.118.235.92]:35065) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8Svv-0003FQ-U0 for qemu-devel@nongnu.org; Thu, 21 Feb 2013 04:59:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U8Svt-0001vn-L6 for qemu-devel@nongnu.org; Thu, 21 Feb 2013 04:59:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:17453) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8Svt-0001vR-CC for qemu-devel@nongnu.org; Thu, 21 Feb 2013 04:59:17 -0500 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 (8.14.4/8.14.4) with ESMTP id r1L9xGOj030041 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 21 Feb 2013 04:59:16 -0500 Received: from rincewind.home.kraxel.org (ovpn-116-21.ams2.redhat.com [10.36.116.21]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r1L9xFlB007145; Thu, 21 Feb 2013 04:59:16 -0500 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id EC0B141AB6; Thu, 21 Feb 2013 10:59:13 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Thu, 21 Feb 2013 10:59:04 +0100 Message-Id: <1361440753-13413-6-git-send-email-kraxel@redhat.com> In-Reply-To: <1361440753-13413-1-git-send-email-kraxel@redhat.com> References: <1361440753-13413-1-git-send-email-kraxel@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: Gerd Hoffmann Subject: [Qemu-devel] [PATCH 05/14] usb-storage: use scsi_req_enqueue return value 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 Signed-off-by: Gerd Hoffmann --- hw/usb/dev-storage.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c index b89d00f..d3f01aa 100644 --- a/hw/usb/dev-storage.c +++ b/hw/usb/dev-storage.c @@ -400,6 +400,7 @@ static void usb_msd_handle_data(USBDevice *dev, USBPacket *p) struct usb_msd_cbw cbw; uint8_t devep = p->ep->nr; SCSIDevice *scsi_dev; + uint32_t len; switch (p->pid) { case USB_TOKEN_OUT: @@ -441,8 +442,8 @@ static void usb_msd_handle_data(USBDevice *dev, USBPacket *p) #ifdef DEBUG_MSD scsi_req_print(s->req); #endif - scsi_req_enqueue(s->req); - if (s->req && s->req->cmd.xfer != SCSI_XFER_NONE) { + len = scsi_req_enqueue(s->req); + if (len) { scsi_req_continue(s->req); } break;