diff options
author | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2011-12-02 14:55:48 -0500 |
---|---|---|
committer | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2011-12-22 04:14:48 -0500 |
commit | 96c1eb9873caffc507a1951c36b43fdcf3ddeff3 (patch) | |
tree | 18f6524c3a07ed30dcc760457672e10cea194d9d /drivers/usb/storage/uas.c | |
parent | 9eb445410db99e5f5f660e97a2165a0567bd909e (diff) |
UAS: Free status URB when we can't find the SCSI tag.
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>
Diffstat (limited to 'drivers/usb/storage/uas.c')
-rw-r--r-- | drivers/usb/storage/uas.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c index 28d9b1909389..9dd4aaee85cc 100644 --- a/drivers/usb/storage/uas.c +++ b/drivers/usb/storage/uas.c | |||
@@ -246,8 +246,10 @@ static void uas_stat_cmplt(struct urb *urb) | |||
246 | cmnd = sdev->current_cmnd; | 246 | cmnd = sdev->current_cmnd; |
247 | else | 247 | else |
248 | cmnd = scsi_find_tag(sdev, tag); | 248 | cmnd = scsi_find_tag(sdev, tag); |
249 | if (!cmnd) | 249 | if (!cmnd) { |
250 | usb_free_urb(urb); | ||
250 | return; | 251 | return; |
252 | } | ||
251 | 253 | ||
252 | switch (iu->iu_id) { | 254 | switch (iu->iu_id) { |
253 | case IU_ID_STATUS: | 255 | case IU_ID_STATUS: |