USB: Add a missing NULL check in Hub constructor.
This case is probably very rare, though.
This commit is contained in:
@@ -69,14 +69,15 @@ Hub::Hub(Object *parent, int8 hubAddress, uint8 hubPort,
|
|||||||
|
|
||||||
usb_interface_list *list = Configuration()->interface;
|
usb_interface_list *list = Configuration()->interface;
|
||||||
Object *object = GetStack()->GetObject(list->active->endpoint[0].handle);
|
Object *object = GetStack()->GetObject(list->active->endpoint[0].handle);
|
||||||
if (object && (object->Type() & USB_OBJECT_INTERRUPT_PIPE) != 0) {
|
if (object != NULL && (object->Type() & USB_OBJECT_INTERRUPT_PIPE) != 0) {
|
||||||
fInterruptPipe = (InterruptPipe *)object;
|
fInterruptPipe = (InterruptPipe *)object;
|
||||||
fInterruptPipe->QueueInterrupt(fInterruptStatus,
|
fInterruptPipe->QueueInterrupt(fInterruptStatus,
|
||||||
sizeof(fInterruptStatus), InterruptCallback, this);
|
sizeof(fInterruptStatus), InterruptCallback, this);
|
||||||
} else {
|
} else {
|
||||||
TRACE_ALWAYS("no interrupt pipe found\n");
|
TRACE_ALWAYS("no interrupt pipe found\n");
|
||||||
}
|
}
|
||||||
object->ReleaseReference();
|
if (object != NULL)
|
||||||
|
object->ReleaseReference();
|
||||||
|
|
||||||
// Wait some time before powering up the ports
|
// Wait some time before powering up the ports
|
||||||
if (!isRootHub)
|
if (!isRootHub)
|
||||||
|
|||||||
Reference in New Issue
Block a user