diff options
author | Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com> | 2006-08-25 19:35:28 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-09-27 11:58:55 -0700 |
commit | cb4c8fe57c05dbb04128503f4a7483a1163b1b47 (patch) | |
tree | 2b03138c98989cc865e8c98cf738a5fd423faa41 /drivers/usb/core/config.c | |
parent | dfe0d3ba20e860d0b9a16c4c6524180b8f93be05 (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>
Diffstat (limited to 'drivers/usb/core/config.c')
-rw-r--r-- | drivers/usb/core/config.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c index 4c9e63e665b..bfb3731d42d 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) if (result < 0) { dev_err(ddev, "unable to read config index %d " "descriptor/%s\n", cfgno, "start"); - goto err; + dev_err(ddev, "chopping to %d config(s)\n", cfgno); + dev->descriptor.bNumConfigurations = cfgno; + break; } else if (result < 4) { dev_err(ddev, "config index %d descriptor too short " "(expected %i, got %i)\n", cfgno, |