Loading...
iokit/Kernel/IODataQueue.cpp xnu-2050.22.13 xnu-1228
--- xnu/xnu-2050.22.13/iokit/Kernel/IODataQueue.cpp
+++ xnu/xnu-1228/iokit/Kernel/IODataQueue.cpp
@@ -73,19 +73,11 @@
 
 Boolean IODataQueue::initWithCapacity(UInt32 size)
 {
-    vm_size_t allocSize = 0;
-
     if (!super::init()) {
         return false;
     }
 
-    allocSize = round_page(size + DATA_QUEUE_MEMORY_HEADER_SIZE);
-
-    if (allocSize < size) {
-        return false;
-    }
-
-    dataQueue = (IODataQueueMemory *)IOMallocAligned(allocSize, PAGE_SIZE);
+    dataQueue = (IODataQueueMemory *)IOMallocAligned(round_page_32(size + DATA_QUEUE_MEMORY_HEADER_SIZE), PAGE_SIZE);
     if (dataQueue == 0) {
         return false;
     }
@@ -105,7 +97,7 @@
 void IODataQueue::free()
 {
     if (dataQueue) {
-        IOFreeAligned(dataQueue, round_page(dataQueue->queueSize + DATA_QUEUE_MEMORY_HEADER_SIZE));
+        IOFreeAligned(dataQueue, round_page_32(dataQueue->queueSize + DATA_QUEUE_MEMORY_HEADER_SIZE));
     }
 
     super::free();
@@ -217,7 +209,7 @@
 
     msgh = (mach_msg_header_t *)notifyMsg;
     if (msgh && msgh->msgh_remote_port) {
-        kr = mach_msg_send_from_kernel_proper(msgh, msgh->msgh_size);
+        kr = mach_msg_send_from_kernel(msgh, msgh->msgh_size);
         switch(kr) {
             case MACH_SEND_TIMED_OUT:	// Notification already sent
             case MACH_MSG_SUCCESS: