Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 354552
b: refs/heads/master
c: aa8f612
h: refs/heads/master
v: v3
  • Loading branch information
Gerd Hoffmann authored and Greg Kroah-Hartman committed Jan 11, 2013
1 parent 95ce84d commit e600228
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 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: 6a099c63650e50ebf7d1259b859a3d230aec4207
refs/heads/master: aa8f612370edf2fd29ec137f7070b11d98df539b
22 changes: 12 additions & 10 deletions trunk/drivers/usb/storage/uas.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ static DECLARE_WORK(uas_work, uas_do_work);
static DEFINE_SPINLOCK(uas_work_lock);
static LIST_HEAD(uas_work_list);

static void uas_unlink_data_urbs(struct uas_dev_info *devinfo,
struct uas_cmd_info *cmdinfo)
{
if (cmdinfo->data_in_urb)
usb_unlink_urb(cmdinfo->data_in_urb);
if (cmdinfo->data_out_urb)
usb_unlink_urb(cmdinfo->data_out_urb);
}

static void uas_do_work(struct work_struct *work)
{
struct uas_cmd_info *cmdinfo;
Expand Down Expand Up @@ -274,16 +283,9 @@ static void uas_stat_cmplt(struct urb *urb)
uas_sense(urb, cmnd);
if (cmnd->result != 0) {
/* cancel data transfers on error */
if (cmdinfo->state & DATA_IN_URB_INFLIGHT) {
spin_unlock_irqrestore(&devinfo->lock, flags);
usb_unlink_urb(cmdinfo->data_in_urb);
spin_lock_irqsave(&devinfo->lock, flags);
}
if (cmdinfo->state & DATA_OUT_URB_INFLIGHT) {
spin_unlock_irqrestore(&devinfo->lock, flags);
usb_unlink_urb(cmdinfo->data_out_urb);
spin_lock_irqsave(&devinfo->lock, flags);
}
spin_unlock_irqrestore(&devinfo->lock, flags);
uas_unlink_data_urbs(devinfo, cmdinfo);
spin_lock_irqsave(&devinfo->lock, flags);
}
cmdinfo->state &= ~COMMAND_INFLIGHT;
uas_try_complete(cmnd, __func__);
Expand Down

0 comments on commit e600228

Please sign in to comment.