Skip to content

Commit 96c1eb9

Browse files
Sarah SharpSebastian Andrzej Siewior
authored andcommitted
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 <[email protected]> Cc: Matthew Wilcox <[email protected]> Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
1 parent 9eb4454 commit 96c1eb9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/usb/storage/uas.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,10 @@ static void uas_stat_cmplt(struct urb *urb)
246246
cmnd = sdev->current_cmnd;
247247
else
248248
cmnd = scsi_find_tag(sdev, tag);
249-
if (!cmnd)
249+
if (!cmnd) {
250+
usb_free_urb(urb);
250251
return;
252+
}
251253

252254
switch (iu->iu_id) {
253255
case IU_ID_STATUS:

0 commit comments

Comments
 (0)