Fixed a wrong index that could cause crashes with devices containing generic descriptors

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19969 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2007-01-26 14:36:03 +00:00
parent 9dbe170a69
commit e40b5c0d59
2 changed files with 2 additions and 2 deletions

View File

@ -128,7 +128,7 @@ BusManager::AllocateDevice(Hub *parent, usb_speed speed)
ControlPipe *defaultPipe = _GetDefaultPipe(speed); ControlPipe *defaultPipe = _GetDefaultPipe(speed);
if (!defaultPipe) { if (!defaultPipe) {
TRACE(("USB BusManager: error getting the default pipe for speed %d\n", (int)speed)); TRACE_ERROR(("USB BusManager: error getting the default pipe for speed %d\n", (int)speed));
FreeAddress(deviceAddress); FreeAddress(deviceAddress);
return NULL; return NULL;
} }

View File

@ -191,7 +191,7 @@ Device::Device(Object *parent, usb_device_descriptor &desc, int8 deviceAddress,
* sizeof(usb_descriptor *)); * sizeof(usb_descriptor *));
/* add this descriptor */ /* add this descriptor */
currentInterface->generic[currentInterface->generic_count] = currentInterface->generic[currentInterface->generic_count - 1] =
(usb_descriptor *)genericDescriptor; (usb_descriptor *)genericDescriptor;
break; break;
} }