summaryrefslogtreecommitdiff
path: root/drivers/staging/ozwpan/ozhcd.c
diff options
context:
space:
mode:
authorRupesh Gujare <rgujare@ozmodevices.com>2012-07-23 18:49:45 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-08-13 19:17:17 -0700
commit5494ebdf3c1ac634b133369736632be82a0255f8 (patch)
tree4631ac87b740167e0939dd53dbe138d58ab5289f /drivers/staging/ozwpan/ozhcd.c
parent24168911bedc23b02a0fa5043befa37580e6a9cb (diff)
staging: ozwpan: Return correct actual_length to userland
This fixes issue where wrong retrun value was received by userland application after writing data to raw hid device. Signed-off-by: Rupesh Gujare <rgujare@ozmodevices.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/ozwpan/ozhcd.c')
-rw-r--r--drivers/staging/ozwpan/ozhcd.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/staging/ozwpan/ozhcd.c b/drivers/staging/ozwpan/ozhcd.c
index 4ac1f2731861..76821cb6d25f 100644
--- a/drivers/staging/ozwpan/ozhcd.c
+++ b/drivers/staging/ozwpan/ozhcd.c
@@ -933,13 +933,14 @@ void oz_hcd_control_cnf(void *hport, u8 req_id, u8 rcode, u8 *data,
} else {
int copy_len;
oz_trace("VENDOR-CLASS - cnf\n");
- if (data_len <= urb->transfer_buffer_length)
- copy_len = data_len;
- else
- copy_len = urb->transfer_buffer_length;
- if (copy_len)
+ if (data_len) {
+ if (data_len <= urb->transfer_buffer_length)
+ copy_len = data_len;
+ else
+ copy_len = urb->transfer_buffer_length;
memcpy(urb->transfer_buffer, data, copy_len);
- urb->actual_length = copy_len;
+ urb->actual_length = copy_len;
+ }
oz_complete_urb(hcd, urb, 0, 0);
}
}
@@ -1517,6 +1518,7 @@ static void oz_process_ep0_urb(struct oz_hcd *ozhcd, struct urb *urb,
int data_len = 0;
if ((setup->bRequestType & USB_DIR_IN) == 0)
data_len = wlength;
+ urb->actual_length = data_len;
if (oz_usb_control_req(port->hpd, req_id, setup,
urb->transfer_buffer, data_len)) {
rc = -ENOMEM;