X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/316670eb35587141e969394ae8537d66b9211e80..99c3a10404e5d1ef94397ab4df5a8b74711fc4d3:/iokit/Kernel/IOInterruptEventSource.cpp diff --git a/iokit/Kernel/IOInterruptEventSource.cpp b/iokit/Kernel/IOInterruptEventSource.cpp index 08ecc626d..6782ec9fe 100644 --- a/iokit/Kernel/IOInterruptEventSource.cpp +++ b/iokit/Kernel/IOInterruptEventSource.cpp @@ -167,19 +167,20 @@ void IOInterruptEventSource::disable() void IOInterruptEventSource::setWorkLoop(IOWorkLoop *inWorkLoop) { - super::setWorkLoop(inWorkLoop); - - if (!provider) - return; - - if ( !inWorkLoop ) { - if (intIndex >= 0) { - provider->unregisterInterrupt(intIndex); + if (inWorkLoop) super::setWorkLoop(inWorkLoop); + + if (provider) { + if (!inWorkLoop) { + if (intIndex >= 0) { + provider->unregisterInterrupt(intIndex); + intIndex = ~intIndex; + } + } else if ((intIndex < 0) && (kIOReturnSuccess == registerInterruptHandler(provider, ~intIndex))) { intIndex = ~intIndex; } - } else if ((intIndex < 0) && (kIOReturnSuccess == registerInterruptHandler(provider, ~intIndex))) { - intIndex = ~intIndex; } + + if (!inWorkLoop) super::setWorkLoop(inWorkLoop); } const IOService *IOInterruptEventSource::getProvider() const