* Work around a problem with a USB device (in my case, Qualcomm Gobi 3G modem) that reports interface_number values that are out of range with the interface_count. This would make the usb stack in Haiku crash.

Will need a different fix to get device to work, but at least Haiku won't crash on bootup with this change.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37409 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ithamar R. Adema
2010-07-05 20:51:59 +00:00
parent 5d7dcef8cd
commit c4c6cedde6
@@ -143,6 +143,11 @@ Device::Device(Object *parent, int8 hubAddress, uint8 hubPort,
TRACE("\tinterface_protocol:.0x%02x\n", interfaceDescriptor->interface_protocol);
TRACE("\tinterface:..........%d\n", interfaceDescriptor->interface);
if (interfaceDescriptor->interface_number >= fConfigurations[i].interface_count) {
interfaceDescriptor->interface_number = fConfigurations[i].interface_count -1;
TRACE_ERROR("Corrected invalid interface_number!\n");
}
usb_interface_list *interfaceList
= &fConfigurations[i].interface[interfaceDescriptor->interface_number];