Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Aaro Koskinen and committed by
Greg Kroah-Hartman
8dcf4ece d8c39d3f

+5 -1
+5 -1
drivers/staging/octeon-usb/octeon-hcd.c
··· 2162 2162 struct usb_hcd *hcd = octeon_to_hcd(priv); 2163 2163 struct device *dev = hcd->self.controller; 2164 2164 2165 - urb->actual_length = bytes_transferred; 2165 + if (likely(status == CVMX_USB_COMPLETE_SUCCESS)) 2166 + urb->actual_length = bytes_transferred; 2167 + else 2168 + urb->actual_length = 0; 2169 + 2166 2170 urb->hcpriv = NULL; 2167 2171 2168 2172 /* For Isochronous transactions we need to update the URB packet status