]> git.karo-electronics.de Git - linux-beck.git/commitdiff
UAS: Free status URB when we can't find the SCSI tag.
authorSarah Sharp <sarah.a.sharp@linux.intel.com>
Fri, 2 Dec 2011 19:55:48 +0000 (11:55 -0800)
committerSebastian Andrzej Siewior <bigeasy@linutronix.de>
Thu, 22 Dec 2011 09:14:48 +0000 (10:14 +0100)
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>
drivers/usb/storage/uas.c

index 28d9b1909389d4197c6e26712cf113359b21ea1b..9dd4aaee85cce2fdd506e3a400a2807773e694ba 100644 (file)
@@ -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: