summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorThomas Pugliese <thomas.pugliese@gmail.com>2014-09-16 16:36:02 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-09-23 22:06:59 -0700
commitb94be0db5b17fe5616ecfc4c064264625f92afb2 (patch)
tree6fb63e4a904b2ad143eb8809f0273beb4ce754fe /drivers/usb
parentf55025289cf7b5694d5c8af13c512660196ee285 (diff)
downloadlinux-b94be0db5b17fe5616ecfc4c064264625f92afb2.tar.bz2
usb: wusbcore: skip done segs before completing aborted transfer
When completing an aborted transfer, skip done segs before calling wa_complete_remaining_xfer_segs to avoid a runtime warning. The warning is harmless in this case but avoiding it prevents false error reports. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/wusbcore/wa-xfer.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/usb/wusbcore/wa-xfer.c b/drivers/usb/wusbcore/wa-xfer.c
index e279015be466..69af4fd9e072 100644
--- a/drivers/usb/wusbcore/wa-xfer.c
+++ b/drivers/usb/wusbcore/wa-xfer.c
@@ -459,14 +459,25 @@ static void __wa_xfer_abort_cb(struct urb *urb)
__func__, urb->status);
if (xfer) {
unsigned long flags;
- int done;
+ int done, seg_index = 0;
struct wa_rpipe *rpipe = xfer->ep->hcpriv;
dev_err(dev, "%s: cleaning up xfer %p ID 0x%08X.\n",
__func__, xfer, wa_xfer_id(xfer));
spin_lock_irqsave(&xfer->lock, flags);
- /* mark all segs as aborted. */
- wa_complete_remaining_xfer_segs(xfer, 0,
+ /* skip done segs. */
+ while (seg_index < xfer->segs) {
+ struct wa_seg *seg = xfer->seg[seg_index];
+
+ if ((seg->status == WA_SEG_DONE) ||
+ (seg->status == WA_SEG_ERROR)) {
+ ++seg_index;
+ } else {
+ break;
+ }
+ }
+ /* mark remaining segs as aborted. */
+ wa_complete_remaining_xfer_segs(xfer, seg_index,
WA_SEG_ABORTED);
done = __wa_xfer_is_done(xfer);
spin_unlock_irqrestore(&xfer->lock, flags);