uas: Fix memleak of non-submitted urbs
authorHans de Goede <hdegoede@redhat.com>
Sat, 13 Sep 2014 10:26:41 +0000 (12:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Sep 2014 04:42:11 +0000 (21:42 -0700)
commit4c5481efb4346948ba7034432f86235a16ac9180
treebacb19c8689964e38d98f7e6878b7dfbca7a667e
parent616f0e6cab4698309ff9e48ee2a85b5eb78cf31a
uas: Fix memleak of non-submitted urbs

Not all urbs we've allocated are necessarily also submitted, non-submitted
urbs will not be free-ed by their completion handler. So we need to free
them manually.

There are 2 scenarios where this can happen:

1) We have failed to submit some urbs at abort / disconnect
2) When running over usb-2 we may have never tried to submit the data urbs
   when completing the scsi cmnd, because we never got a READ/WRITE_READY iu

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/storage/uas.c