Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 316877
b: refs/heads/master
c: 8aac863
h: refs/heads/master
i:
  316875: f433428
v: v3
  • Loading branch information
Gerd Hoffmann authored and Greg Kroah-Hartman committed Jun 25, 2012
1 parent 88213ea commit 4ba9d9b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b1d6769333496b05818fe6cec72ef7f7504ef9e4
refs/heads/master: 8aac863e9295c42683b5b39ab65e17711e21b34c
14 changes: 13 additions & 1 deletion trunk/drivers/usb/storage/uas.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,13 @@ static void uas_stat_cmplt(struct urb *urb)
uas_sense_old(urb, cmnd);
else
uas_sense(urb, cmnd);
if (cmnd->result != 0) {
/* cancel data transfers on error */
if (cmdinfo->state & DATA_IN_URB_INFLIGHT)
usb_unlink_urb(cmdinfo->data_in_urb);
if (cmdinfo->state & DATA_OUT_URB_INFLIGHT)
usb_unlink_urb(cmdinfo->data_out_urb);
}
cmdinfo->state &= ~COMMAND_INFLIGHT;
uas_try_complete(cmnd, __func__);
break;
Expand Down Expand Up @@ -272,7 +279,12 @@ static void uas_data_cmplt(struct urb *urb)
cmdinfo->state &= ~DATA_OUT_URB_INFLIGHT;
}
BUG_ON(sdb == NULL);
sdb->resid = sdb->length - urb->actual_length;
if (urb->status) {
/* error: no data transfered */
sdb->resid = sdb->length;
} else {
sdb->resid = sdb->length - urb->actual_length;
}
uas_try_complete(cmnd, __func__);
}

Expand Down

0 comments on commit 4ba9d9b

Please sign in to comment.