Skip to content

Commit

Permalink
usb: deal with broken config descriptors
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Inaky Perez-Gonzalez authored and Greg Kroah-Hartman committed Sep 27, 2006
1 parent dfe0d3b commit cb4c8fe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/usb/core/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit cb4c8fe

Please sign in to comment.