diff --git a/src/add-ons/kernel/busses/usb/ehci.cpp b/src/add-ons/kernel/busses/usb/ehci.cpp index 80d0315f4b..261cb0cb68 100644 --- a/src/add-ons/kernel/busses/usb/ehci.cpp +++ b/src/add-ons/kernel/busses/usb/ehci.cpp @@ -2039,9 +2039,6 @@ EHCI::LinkQueueHead(ehci_qh *queueHead) status_t EHCI::LinkInterruptQueueHead(ehci_qh *queueHead, Pipe *pipe) { - if (!Lock()) - return B_ERROR; - uint8 interval = pipe->Interval(); if (pipe->Speed() == USB_SPEED_HIGHSPEED) { // Allow interrupts to be scheduled on each possible micro frame. @@ -2070,6 +2067,9 @@ EHCI::LinkInterruptQueueHead(ehci_qh *queueHead, Pipe *pipe) if (interval > EHCI_INTERRUPT_ENTRIES_COUNT) interval = EHCI_INTERRUPT_ENTRIES_COUNT; + if (!Lock()) + return B_ERROR; + ehci_qh *interruptQueue = &fInterruptEntries[interval - 1].queue_head; queueHead->next_phy = interruptQueue->next_phy; queueHead->next_log = interruptQueue->next_log;