Skip to content

Commit

Permalink
UAS: Free status URB when we can't find the SCSI tag.
Browse files Browse the repository at this point in the history
In the UAS status URB completion handler, we need to free the URB, no
matter what happens.  Fix a bug where we would leak the URB (and its
buffer) if we couldn't find a SCSI command that is associated with this
status phase.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
  • Loading branch information
Sarah Sharp authored and Sebastian Andrzej Siewior committed Dec 22, 2011
1 parent 9eb4454 commit 96c1eb9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/usb/storage/uas.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,10 @@ static void uas_stat_cmplt(struct urb *urb)
cmnd = sdev->current_cmnd;
else
cmnd = scsi_find_tag(sdev, tag);
if (!cmnd)
if (!cmnd) {
usb_free_urb(urb);
return;
}

switch (iu->iu_id) {
case IU_ID_STATUS:
Expand Down

0 comments on commit 96c1eb9

Please sign in to comment.