Skip to content

Commit

Permalink
* Work around a problem with a USB device (in my case, Qualcomm Gobi …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
Ithamar R. Adema committed Jul 5, 2010
1 parent 5d7dcef commit c4c6ced
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/add-ons/kernel/bus_managers/usb/Device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down

0 comments on commit c4c6ced

Please sign in to comment.