aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/core/devio.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index e0f107948eba..62679bc031fb 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -1604,10 +1604,14 @@ static int processcompl_compat(struct async *as, void __user * __user *arg)
1604 void __user *addr = as->userurb; 1604 void __user *addr = as->userurb;
1605 unsigned int i; 1605 unsigned int i;
1606 1606
1607 if (as->userbuffer && urb->actual_length) 1607 if (as->userbuffer && urb->actual_length) {
1608 if (copy_to_user(as->userbuffer, urb->transfer_buffer, 1608 if (urb->number_of_packets > 0) /* Isochronous */
1609 urb->actual_length)) 1609 i = urb->transfer_buffer_length;
1610 else /* Non-Isoc */
1611 i = urb->actual_length;
1612 if (copy_to_user(as->userbuffer, urb->transfer_buffer, i))
1610 return -EFAULT; 1613 return -EFAULT;
1614 }
1611 if (put_user(as->status, &userurb->status)) 1615 if (put_user(as->status, &userurb->status))
1612 return -EFAULT; 1616 return -EFAULT;
1613 if (put_user(urb->actual_length, &userurb->actual_length)) 1617 if (put_user(urb->actual_length, &userurb->actual_length))