Skip to content

Commit 4084e35

Browse files
committed
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: 7ad3d51 ("usb: add short-packet handling to usb-storage driver") Reported-by: Sai Pavan Boddu <[email protected]> Tested-by: Paul Zimmerman <[email protected]> Signed-off-by: Gerd Hoffmann <[email protected]> Message-id: [email protected]
1 parent 8ec1415 commit 4084e35

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

hw/usb/dev-storage.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,8 +546,7 @@ static void usb_msd_handle_data(USBDevice *dev, USBPacket *p)
546546
}
547547
}
548548
}
549-
if (p->actual_length < p->iov.size && (p->short_not_ok ||
550-
s->scsi_len >= p->ep->max_packet_size)) {
549+
if (p->actual_length < p->iov.size && s->mode == USB_MSDM_DATAIN) {
551550
DPRINTF("Deferring packet %p [wait data-in]\n", p);
552551
s->packet = p;
553552
p->status = USB_RET_ASYNC;

0 commit comments

Comments
 (0)