mirror of
https://review.haiku-os.org/haiku
synced 2024-11-23 07:18:40 +01:00
USB: Add a missing NULL check in Hub constructor.
This case is probably very rare, though.
This commit is contained in:
parent
8500b11c43
commit
75a4dfe4a1
@ -69,14 +69,15 @@ Hub::Hub(Object *parent, int8 hubAddress, uint8 hubPort,
|
||||
|
||||
usb_interface_list *list = Configuration()->interface;
|
||||
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->QueueInterrupt(fInterruptStatus,
|
||||
sizeof(fInterruptStatus), InterruptCallback, this);
|
||||
} else {
|
||||
TRACE_ALWAYS("no interrupt pipe found\n");
|
||||
}
|
||||
object->ReleaseReference();
|
||||
if (object != NULL)
|
||||
object->ReleaseReference();
|
||||
|
||||
// Wait some time before powering up the ports
|
||||
if (!isRootHub)
|
||||
|
Loading…
Reference in New Issue
Block a user