Commit 4084e350 authored by Gerd Hoffmann's avatar Gerd Hoffmann
Browse files

usb: fix storage regression



Fix the contition to figure whenever we need to wait for more data or
not.  Simply check the mode, if we are not in DATAIN state any more we
are done already and don't need to go ASYNC.

Fixes: 7ad3d51e ("usb: add short-packet handling to usb-storage driver")
Reported-by: default avatarSai Pavan Boddu <saipava@xilinx.com>
Tested-by: default avatarPaul Zimmerman <pauldzim@gmail.com>
Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
Message-id: 20200713062712.1476-1-kraxel@redhat.com
parent 8ec14159
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -546,8 +546,7 @@ static void usb_msd_handle_data(USBDevice *dev, USBPacket *p)
                    }
                }
            }
            if (p->actual_length < p->iov.size && (p->short_not_ok ||
                    s->scsi_len >= p->ep->max_packet_size)) {
            if (p->actual_length < p->iov.size && s->mode == USB_MSDM_DATAIN) {
                DPRINTF("Deferring packet %p [wait data-in]\n", p);
                s->packet = p;
                p->status = USB_RET_ASYNC;