aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorInaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>2006-08-25 22:35:28 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-09-27 14:58:55 -0400
commitcb4c8fe57c05dbb04128503f4a7483a1163b1b47 (patch)
tree2b03138c98989cc865e8c98cf738a5fd423faa41
parentdfe0d3ba20e860d0b9a16c4c6524180b8f93be05 (diff)
usb: deal with broken config descriptors
Change usb_get_configuration() so that it is more tolerant to devices with bad configuration descriptors (it'll make it ignore configurations that fail to load). Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/usb/core/config.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index 4c9e63e665b6..bfb3731d42db 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -475,7 +475,9 @@ int usb_get_configuration(struct usb_device *dev)
475 if (result < 0) { 475 if (result < 0) {
476 dev_err(ddev, "unable to read config index %d " 476 dev_err(ddev, "unable to read config index %d "
477 "descriptor/%s\n", cfgno, "start"); 477 "descriptor/%s\n", cfgno, "start");
478 goto err; 478 dev_err(ddev, "chopping to %d config(s)\n", cfgno);
479 dev->descriptor.bNumConfigurations = cfgno;
480 break;
479 } else if (result < 4) { 481 } else if (result < 4) {
480 dev_err(ddev, "config index %d descriptor too short " 482 dev_err(ddev, "config index %d descriptor too short "
481 "(expected %i, got %i)\n", cfgno, 483 "(expected %i, got %i)\n", cfgno,