usb-storage: use scsi_req_enqueue return value
authorGerd Hoffmann <kraxel@redhat.com>
Tue, 22 Jan 2013 13:17:05 +0000 (14:17 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 19 Feb 2013 11:30:04 +0000 (12:30 +0100)
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb/dev-storage.c

index b89d00f7cf1aa4cd22479898677bffcf97232a86..d3f01aa2a75d531570865c5d5f2db8f73cdbc6dc 100644 (file)
@@ -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;