Loading...
--- xnu/xnu-12377.121.6/iokit/Kernel/IODMAEventSource.cpp
+++ xnu/xnu-6153.11.26/iokit/Kernel/IODMAEventSource.cpp
@@ -26,8 +26,6 @@
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
-#define IOKIT_ENABLE_SHARED_PTR
-
#include <IOKit/IODMAEventSource.h>
#include <IOKit/IOService.h>
@@ -59,10 +57,11 @@
dmaCompletionAction = inCompletion;
dmaNotificationAction = inNotification;
- dmaController.reset(IODMAController::getController(dmaProvider, inDMAIndex), OSRetain);
+ dmaController = IODMAController::getController(dmaProvider, inDMAIndex);
if (dmaController == NULL) {
return false;
}
+ dmaController->retain();
result = dmaController->initDMAChannel(dmaProvider, this, &dmaIndex, inDMAIndex);
if (result != kIOReturnSuccess) {
@@ -84,17 +83,18 @@
super::free();
}
-OSSharedPtr<IODMAEventSource>
+IODMAEventSource *
IODMAEventSource::dmaEventSource(OSObject *inOwner,
IOService *inProvider,
Action inCompletion,
Action inNotification,
UInt32 inDMAIndex)
{
- OSSharedPtr<IODMAEventSource> dmaES = OSMakeShared<IODMAEventSource>();
+ IODMAEventSource *dmaES = new IODMAEventSource;
if (dmaES && !dmaES->init(inOwner, inProvider, inCompletion, inNotification, inDMAIndex)) {
- return nullptr;
+ dmaES->release();
+ return NULL;
}
return dmaES;