summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Hetier <[email protected]>2020-04-02 11:50:18 -0700
committerGuillaume Hetier <[email protected]>2020-04-02 11:50:18 -0700
commit2dc195e508f841d3393e031123abeecefa30b6e4 (patch)
treea0b883d8af8b8c31e821f14961911705108c50ec
parentdd4fad494b996f5729be98e0271ea74ef1a5d2ad (diff)
Fix deprecated pool allocation function
-rw-r--r--network/wlan/WDI/PLATFORM/NDIS6/SDIO/N6SdioPlatformWindows.c30
-rw-r--r--network/wlan/WDI/PLATFORM/NDIS6/SDIO/N6Sdio_main.c7
2 files changed, 15 insertions, 22 deletions
diff --git a/network/wlan/WDI/PLATFORM/NDIS6/SDIO/N6SdioPlatformWindows.c b/network/wlan/WDI/PLATFORM/NDIS6/SDIO/N6SdioPlatformWindows.c
index d48ee104..86a16e03 100644
--- a/network/wlan/WDI/PLATFORM/NDIS6/SDIO/N6SdioPlatformWindows.c
+++ b/network/wlan/WDI/PLATFORM/NDIS6/SDIO/N6SdioPlatformWindows.c
@@ -1006,17 +1006,15 @@ PlatformSdioGetProperty(
PSDBUS_REQUEST_PACKET psdrp = NULL;
NTSTATUS status;
- psdrp = (PSDBUS_REQUEST_PACKET)ExAllocatePoolWithTag(NonPagedPool, sizeof(SDBUS_REQUEST_PACKET), '3278');
+ psdrp = (PSDBUS_REQUEST_PACKET)ExAllocatePool2(POOL_FLAG_NON_PAGED, sizeof(SDBUS_REQUEST_PACKET), '3278');
if(!psdrp)
return STATUS_INSUFFICIENT_RESOURCES;
- RtlZeroMemory(psdrp, sizeof(SDBUS_REQUEST_PACKET));
-
- psdrp->RequestFunction = SDRF_GET_PROPERTY;
- psdrp->Parameters.GetSetProperty.Property = Property;
- psdrp->Parameters.GetSetProperty.Buffer = Buffer;
- psdrp->Parameters.GetSetProperty.Length = Length;
+ psdrp->RequestFunction = SDRF_GET_PROPERTY;
+ psdrp->Parameters.GetSetProperty.Property = Property;
+ psdrp->Parameters.GetSetProperty.Buffer = Buffer;
+ psdrp->Parameters.GetSetProperty.Length = Length;
NdisAcquireSpinLock( &(pDevice->IrpSpinLock) );
RT_SDIO_INC_CMD_REF(pDevice);
@@ -1062,17 +1060,15 @@ PlatformSdioSetProperty(
PSDBUS_REQUEST_PACKET psdrp = NULL;
NTSTATUS status;
- psdrp = (PSDBUS_REQUEST_PACKET)ExAllocatePoolWithTag(NonPagedPool, sizeof(SDBUS_REQUEST_PACKET), '3278');
+ psdrp = (PSDBUS_REQUEST_PACKET)ExAllocatePool2(POOL_FLAG_NON_PAGED, sizeof(SDBUS_REQUEST_PACKET), '3278');
if(!psdrp)
return STATUS_INSUFFICIENT_RESOURCES;
- RtlZeroMemory(psdrp, sizeof(SDBUS_REQUEST_PACKET));
-
- psdrp->RequestFunction = SDRF_SET_PROPERTY;
- psdrp->Parameters.GetSetProperty.Property = Property;
- psdrp->Parameters.GetSetProperty.Buffer = Buffer;
- psdrp->Parameters.GetSetProperty.Length = Length;
+ psdrp->RequestFunction = SDRF_SET_PROPERTY;
+ psdrp->Parameters.GetSetProperty.Property = Property;
+ psdrp->Parameters.GetSetProperty.Buffer = Buffer;
+ psdrp->Parameters.GetSetProperty.Length = Length;
NdisAcquireSpinLock( &(pDevice->IrpSpinLock) );
RT_SDIO_INC_CMD_REF(pDevice);
@@ -1409,14 +1405,12 @@ PlatformSdioCmd53ReadWriteMDL(
//
// Now allocate a request packet for the arguments of the command.
//
- psdrp = ExAllocatePoolWithTag(NonPagedPool, sizeof(SDBUS_REQUEST_PACKET), '3278');
+ psdrp = ExAllocatePool2(POOL_FLAG_NON_PAGED, sizeof(SDBUS_REQUEST_PACKET), '3278');
if(!psdrp)
{
RT_TRACE(COMP_IO, DBG_SERIOUS, ("PlatformSdioCmd53ReadWriteMDL(): Allocate sdrp fail!!\n"));
return rtstatus;
}
-
- RtlZeroMemory(psdrp, sizeof(SDBUS_REQUEST_PACKET));
psdrp->RequestFunction = SDRF_DEVICE_COMMAND;
psdrp->Parameters.DeviceCommand.Mdl = pmdl;
@@ -2985,7 +2979,7 @@ PrepareSdioAWBs(
//
// Allocate SD Request Packet
//
- device->pAsynIoWriteSdrp = (PSDBUS_REQUEST_PACKET)ExAllocatePoolWithTag(NonPagedPool, sizeof(SDBUS_REQUEST_PACKET), '3278');
+ device->pAsynIoWriteSdrp = (PSDBUS_REQUEST_PACKET)ExAllocatePool2(POOL_FLAG_NON_PAGED, sizeof(SDBUS_REQUEST_PACKET), '3278');
if(device->pAsynIoWriteSdrp == NULL)
goto Error;
diff --git a/network/wlan/WDI/PLATFORM/NDIS6/SDIO/N6Sdio_main.c b/network/wlan/WDI/PLATFORM/NDIS6/SDIO/N6Sdio_main.c
index fb9160a4..1165eed1 100644
--- a/network/wlan/WDI/PLATFORM/NDIS6/SDIO/N6Sdio_main.c
+++ b/network/wlan/WDI/PLATFORM/NDIS6/SDIO/N6Sdio_main.c
@@ -1489,10 +1489,9 @@ N6SdioInitTxQueue(
pDevice->RtNumTxQueue = SDIO_MAX_TX_QUEUE; // TX_HIQ, TX_MIQ and TX_LOQ
// Initialize the contexts in Tx Queue.
- pDevice->RtTxQueue =
- (PRT_SDIO_TX_QUEUE)ExAllocatePoolWithTag(NonPagedPool, SDIO_MAX_TX_QUEUE*sizeof(RT_SDIO_TX_QUEUE), '3278' );
- PlatformZeroMemory(pDevice->RtTxQueue, SDIO_MAX_TX_QUEUE*sizeof(RT_SDIO_TX_QUEUE));
-
+ pDevice->RtTxQueue =
+ (PRT_SDIO_TX_QUEUE)ExAllocatePool2(POOL_FLAG_NON_PAGED, SDIO_MAX_TX_QUEUE*sizeof(RT_SDIO_TX_QUEUE), '3278' );
+
if (pDevice->RtTxQueue != NULL)
{