X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/c18c124eaa464aaaa5549e99e5a70fc9cbb50944..3e170ce000f1506b7b5d2c5c7faec85ceabb573d:/iokit/Kernel/IOWorkLoop.cpp?ds=sidebyside diff --git a/iokit/Kernel/IOWorkLoop.cpp b/iokit/Kernel/IOWorkLoop.cpp index 0789f66bb..6207b1ea1 100644 --- a/iokit/Kernel/IOWorkLoop.cpp +++ b/iokit/Kernel/IOWorkLoop.cpp @@ -255,6 +255,7 @@ void IOWorkLoop::free() // Either way clean up all of our resources and return. if (controlG) { + controlG->workLoop = 0; controlG->release(); controlG = 0; } @@ -559,10 +560,10 @@ IOReturn IOWorkLoop::_maintRequest(void *inC, void *inD, void *, void *) if (eventChain == inEvent) eventChain = inEvent->getNext(); else { - IOEventSource *event, *next; + IOEventSource *event, *next = 0; event = eventChain; - while ((next = event->getNext()) && next != inEvent) + if (event) while ((next = event->getNext()) && (next != inEvent)) event = next; if (!next) { @@ -576,10 +577,10 @@ IOReturn IOWorkLoop::_maintRequest(void *inC, void *inD, void *, void *) if (passiveEventChain == inEvent) passiveEventChain = inEvent->getNext(); else { - IOEventSource *event, *next; + IOEventSource *event, *next = 0; event = passiveEventChain; - while ((next = event->getNext()) && next != inEvent) + if (event) while ((next = event->getNext()) && (next != inEvent)) event = next; if (!next) {