summaryrefslogtreecommitdiff
path: root/hw/usb/host-linux.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2012-11-15 16:11:49 +0100
committerGerd Hoffmann <kraxel@redhat.com>2012-11-16 11:27:32 +0100
commit71e0aa3930e7ac2e039b175ffad222e3dc5b1813 (patch)
tree5cbd3a2b7e6ae773d6cc766733648df8b56bff67 /hw/usb/host-linux.c
parent8c908fca584dbf47094b63f132bb49b82eaa3e19 (diff)
downloadqemu-71e0aa3930e7ac2e039b175ffad222e3dc5b1813.tar.gz
usb-host: fix splitted transfers
USBPacket->actual_length wasn't updated correctly for USBPackets splitted into multiple urbs. Fix it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb/host-linux.c')
-rw-r--r--hw/usb/host-linux.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/hw/usb/host-linux.c b/hw/usb/host-linux.c
index e3d394fcef..aa77b7704d 100644
--- a/hw/usb/host-linux.c
+++ b/hw/usb/host-linux.c
@@ -366,8 +366,11 @@ static void async_complete(void *opaque)
if (p) {
switch (aurb->urb.status) {
case 0:
- p->actual_length = aurb->urb.actual_length;
- p->status = USB_RET_SUCCESS; /* Clear previous ASYNC status */
+ p->actual_length += aurb->urb.actual_length;
+ if (!aurb->more) {
+ /* Clear previous ASYNC status */
+ p->status = USB_RET_SUCCESS;
+ }
break;
case -EPIPE: