aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/generic.c
diff options
context:
space:
mode:
authorAlan Stern <[email protected]>2010-04-20 14:40:59 +0000
committerGreg Kroah-Hartman <[email protected]>2010-04-30 16:25:10 +0000
commit62f9cfa3ece58268b3e92ca59c23b175f86205aa (patch)
tree5990f644a00870876cb34f0afea1012215413f47 /drivers/usb/core/generic.c
parentUSB: cdc-acm: add another device quirk (diff)
downloadkernel-62f9cfa3ece58268b3e92ca59c23b175f86205aa.tar.gz
kernel-62f9cfa3ece58268b3e92ca59c23b175f86205aa.zip
USB: don't choose configs with no interfaces
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 <[email protected]> Tested-by: Andrew Victor <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/usb/core/generic.c')
-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 bdf87a8414a1..2c95153c0f24 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;