Hi,

Attached patch resolves buggy allocation of memory in NDISulator.
Correct behavior is to not ignore parameters specified by miniport driver.
diff --git a/src/sys/compat/ndis/subr_ntoskrnl.c 
b/src/sys/compat/ndis/subr_ntoskrnl.c
index 04184ae..f169de5 100644
--- a/src/sys/compat/ndis/subr_ntoskrnl.c
+++ b/src/sys/compat/ndis/subr_ntoskrnl.c
@@ -2426,12 +2426,9 @@ MmAllocateContiguousMemorySpecifyCache(size, lowest, 
highest,
        uint64_t                boundary;
        uint32_t                cachetype;
 {
-       void *addr;
-       size_t pagelength = roundup(size, PAGE_SIZE);
-
-       addr = ExAllocatePoolWithTag(NonPagedPool, pagelength, 0);
 
-       return (addr);
+       return (contigmalloc(size, M_DEVBUF, M_ZERO|M_NOWAIT, lowest,
+           highest, PAGE_SIZE, boundary));
 }
 
 static void
@@ -2447,7 +2444,7 @@ MmFreeContiguousMemorySpecifyCache(base, size, cachetype)
        uint32_t                size;
        uint32_t                cachetype;
 {
-       ExFreePool(base);
+       contigfree(base, size, M_DEVBUF);
 }
 
 static uint32_t
_______________________________________________
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"

Reply via email to