xhci: Return correct number of tranferred bytes for stalled control endpoints
authorMathias Nyman <mathias.nyman@linux.intel.com>
Fri, 29 May 2015 14:01:53 +0000 (17:01 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 31 May 2015 06:45:31 +0000 (15:45 +0900)
Fix the xhci driver from bluntly setting the transferred length to 0 if
we get a STALL on anything else than the data stage of a control transfer.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-ring.c

index d7fd5efd3bd5535a2fea6873920ba5c26c397d5b..94416ff7081071e3f32a682493e6a34bb8d359a8 100644 (file)
@@ -1934,7 +1934,7 @@ static int process_ctrl_td(struct xhci_hcd *xhci, struct xhci_td *td,
                        td->urb->actual_length =
                                td->urb->transfer_buffer_length -
                                EVENT_TRB_LEN(le32_to_cpu(event->transfer_len));
-               else
+               else if (!td->urb_length_set)
                        td->urb->actual_length = 0;
 
                return finish_td(xhci, td, event_trb, event, ep, status, false);