Move mutex initialization earlier, analogous to hrev43320.
Avoids crashing if the bus manager init fails. Also fixes CID 10846.
This commit is contained in:
@@ -109,6 +109,7 @@ EHCI::EHCI(pci_info *info, Stack *stack)
|
|||||||
fPCIInfo(info),
|
fPCIInfo(info),
|
||||||
fStack(stack),
|
fStack(stack),
|
||||||
fEnabledInterrupts(0),
|
fEnabledInterrupts(0),
|
||||||
|
fThreshold(0),
|
||||||
fPeriodicFrameListArea(-1),
|
fPeriodicFrameListArea(-1),
|
||||||
fPeriodicFrameList(NULL),
|
fPeriodicFrameList(NULL),
|
||||||
fInterruptEntries(NULL),
|
fInterruptEntries(NULL),
|
||||||
@@ -136,6 +137,9 @@ EHCI::EHCI(pci_info *info, Stack *stack)
|
|||||||
fPortSuspendChange(0),
|
fPortSuspendChange(0),
|
||||||
fInterruptPollThread(-1)
|
fInterruptPollThread(-1)
|
||||||
{
|
{
|
||||||
|
// Create a lock for the isochronous transfer list
|
||||||
|
mutex_init(&fIsochronousLock, "EHCI isochronous lock");
|
||||||
|
|
||||||
if (BusManager::InitCheck() < B_OK) {
|
if (BusManager::InitCheck() < B_OK) {
|
||||||
TRACE_ERROR("bus manager failed to init\n");
|
TRACE_ERROR("bus manager failed to init\n");
|
||||||
return;
|
return;
|
||||||
@@ -305,9 +309,6 @@ EHCI::EHCI(pci_info *info, Stack *stack)
|
|||||||
B_NORMAL_PRIORITY, (void *)this);
|
B_NORMAL_PRIORITY, (void *)this);
|
||||||
resume_thread(fFinishThread);
|
resume_thread(fFinishThread);
|
||||||
|
|
||||||
// Create a lock for the isochronous transfer list
|
|
||||||
mutex_init(&fIsochronousLock, "EHCI isochronous lock");
|
|
||||||
|
|
||||||
// Create semaphore the isochronous finisher thread will wait for
|
// Create semaphore the isochronous finisher thread will wait for
|
||||||
fFinishIsochronousTransfersSem = create_sem(0,
|
fFinishIsochronousTransfersSem = create_sem(0,
|
||||||
"EHCI Isochronous Finish Transfers");
|
"EHCI Isochronous Finish Transfers");
|
||||||
|
|||||||
Reference in New Issue
Block a user