staging: octeon-usb: return transferred bytes only on success

Return transferred bytes only when transfer was successful.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Aaro Koskinen 2014-06-29 22:52:55 +03:00 committed by Greg Kroah-Hartman
parent d8c39d3f20
commit 8dcf4ecea9
1 changed files with 5 additions and 1 deletions

View File

@ -2162,7 +2162,11 @@ static void octeon_usb_urb_complete_callback(struct cvmx_usb_state *usb,
struct usb_hcd *hcd = octeon_to_hcd(priv);
struct device *dev = hcd->self.controller;
urb->actual_length = bytes_transferred;
if (likely(status == CVMX_USB_COMPLETE_SUCCESS))
urb->actual_length = bytes_transferred;
else
urb->actual_length = 0;
urb->hcpriv = NULL;
/* For Isochronous transactions we need to update the URB packet status