summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2010-04-20 10:40:59 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-12 15:02:37 -0700
commit3056f8ac2c84c3007726c00e4142eff0ff4db23e (patch)
tree4b86c58d7684f37779643e187f088c3f1636ce41 /drivers/usb
parenta52298dba1c83b9ea7557c92c0200d325a966a99 (diff)
downloadkernel-crypto-3056f8ac2c84c3007726c00e4142eff0ff4db23e.tar.gz
kernel-crypto-3056f8ac2c84c3007726c00e4142eff0ff4db23e.tar.xz
kernel-crypto-3056f8ac2c84c3007726c00e4142eff0ff4db23e.zip
USB: don't choose configs with no interfaces
commit 62f9cfa3ece58268b3e92ca59c23b175f86205aa upstream. This patch (as1372) fixes a bug in the routine that chooses the default configuration to install when a new USB device is detected. The algorithm is supposed to look for a config whose first interface is for a non-vendor-specific class. But the way it's currently written, it will also accept a config with no interfaces at all, which is not very useful. (Believe it or not, such things do exist.) Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Tested-by: Andrew Victor <avictor.za@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/core/generic.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/core/generic.c b/drivers/usb/core/generic.c
index bdf87a8414a..2c95153c0f2 100644
--- a/drivers/usb/core/generic.c
+++ b/drivers/usb/core/generic.c
@@ -120,7 +120,7 @@ int usb_choose_configuration(struct usb_device *udev)
* than a vendor-specific driver. */
else if (udev->descriptor.bDeviceClass !=
USB_CLASS_VENDOR_SPEC &&
- (!desc || desc->bInterfaceClass !=
+ (desc && desc->bInterfaceClass !=
USB_CLASS_VENDOR_SPEC)) {
best = c;
break;