diff options
author | Aaro Koskinen <aaro.koskinen@iki.fi> | 2014-06-29 22:52:55 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-08 16:39:22 -0700 |
commit | 8dcf4ecea91582ec9c816d91f06475ba92a65ed7 (patch) | |
tree | 7454fb447716eb9003bcecb511358b4f580ac97c /drivers/staging/octeon-usb | |
parent | d8c39d3f20049473a6d489deb82b5219f2a21316 (diff) | |
download | op-kernel-dev-8dcf4ecea91582ec9c816d91f06475ba92a65ed7.zip op-kernel-dev-8dcf4ecea91582ec9c816d91f06475ba92a65ed7.tar.gz |
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>
Diffstat (limited to 'drivers/staging/octeon-usb')
-rw-r--r-- | drivers/staging/octeon-usb/octeon-hcd.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/staging/octeon-usb/octeon-hcd.c b/drivers/staging/octeon-usb/octeon-hcd.c index 59cf921..a65b708 100644 --- a/drivers/staging/octeon-usb/octeon-hcd.c +++ b/drivers/staging/octeon-usb/octeon-hcd.c @@ -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 |