Loading...
iokit/Kernel/IOInterruptEventSource.cpp xnu-2422.100.13 xnu-2050.7.9
--- xnu/xnu-2422.100.13/iokit/Kernel/IOInterruptEventSource.cpp
+++ xnu/xnu-2050.7.9/iokit/Kernel/IOInterruptEventSource.cpp
@@ -167,20 +167,19 @@
 
 void IOInterruptEventSource::setWorkLoop(IOWorkLoop *inWorkLoop)
 {
-    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))) {
+    super::setWorkLoop(inWorkLoop);
+
+    if (!provider)
+    	return;
+
+    if ( !inWorkLoop ) {
+	if (intIndex >= 0) {
+	    provider->unregisterInterrupt(intIndex);
 	    intIndex = ~intIndex;
 	}
-    }
-
-    if (!inWorkLoop) super::setWorkLoop(inWorkLoop);
+    } else if ((intIndex < 0) && (kIOReturnSuccess == registerInterruptHandler(provider, ~intIndex))) {
+	intIndex = ~intIndex;
+    }
 }
 
 const IOService *IOInterruptEventSource::getProvider() const