From: Inaky Perez-Gonzalez Date: Sat, 26 Aug 2006 02:35:28 +0000 (-0700) Subject: usb: deal with broken config descriptors X-Git-Tag: MMI-PSA29.97-13-9~47266^2~55 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cb4c8fe57c05dbb04128503f4a7483a1163b1b47;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 Signed-off-by: Greg Kroah-Hartman --- 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) 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,