summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2013-11-16 11:37:41 +0100
committerSarah Sharp <sarah.a.sharp@linux.intel.com>2014-03-04 15:38:19 -0800
commit6134041bef0aeb9cb7c8a8daf045b44513cd8396 (patch)
treed5f11807b5992088d062df404d0bf13686b36b33 /drivers/usb
parent74d71aec619f33ec1ff5b2090792ab96d840bd3b (diff)
downloadtalos-op-linux-6134041bef0aeb9cb7c8a8daf045b44513cd8396.tar.gz
talos-op-linux-6134041bef0aeb9cb7c8a8daf045b44513cd8396.zip
uas: Verify endpoint descriptors from uas_use_uas_driver()
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/storage/uas-detect.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/usb/storage/uas-detect.h b/drivers/usb/storage/uas-detect.h
index 8de030a0a4a4..b8a02e12a8a2 100644
--- a/drivers/usb/storage/uas-detect.h
+++ b/drivers/usb/storage/uas-detect.h
@@ -70,13 +70,23 @@ static int uas_find_endpoints(struct usb_host_interface *alt,
static int uas_use_uas_driver(struct usb_interface *intf,
const struct usb_device_id *id)
{
+ struct usb_host_endpoint *eps[4] = { };
struct usb_device *udev = interface_to_usbdev(intf);
unsigned long flags = id->driver_info;
+ int r, alt;
usb_stor_adjust_quirks(udev, &flags);
if (flags & US_FL_IGNORE_UAS)
return 0;
- return uas_find_uas_alt_setting(intf) >= 0;
+ alt = uas_find_uas_alt_setting(intf);
+ if (alt < 0)
+ return 0;
+
+ r = uas_find_endpoints(&intf->altsetting[alt], eps);
+ if (r < 0)
+ return 0;
+
+ return 1;
}
OpenPOWER on IntegriCloud