[ofw] [PATCH] winverbs/winmad: use ExFreePoolWithTag

Sean Hefty sean.hefty at intel.com
Thu Aug 27 11:55:36 PDT 2009


To help match memory allocations with free, replace ExFreePool with
ExFreePoolWithTag.

Signed-off-by: Sean Hefty <sean.hefty at intel.com>
---
This is *NOT* required for winof 2.1

Index: core/winmad/kernel/wm_driver.c
===================================================================
--- core/winmad/kernel/wm_driver.c	(revision 2373)
+++ core/winmad/kernel/wm_driver.c	(working copy)
@@ -247,7 +247,7 @@
 	ib_status = pDevice->VerbsInterface.Verbs.
 
query_ca(pDevice->VerbsInterface.Verbs.p_hca_obj, attr, &size, NULL);
 	if (ib_status != IB_SUCCESS) {
-		ExFreePool(attr);
+		ExFreePoolWithTag(attr, 'acmw');
 		attr = NULL;
 	}
 
@@ -282,7 +282,7 @@
 
 	status = STATUS_SUCCESS;
 out:
-	ExFreePool(attr);
+	ExFreePoolWithTag(attr, 'acmw');
 	return status;
 }
 
@@ -361,7 +361,7 @@
 
 
pdev->IbInterface.wdm.InterfaceDereference(pdev->IbInterface.wdm.Context);
 	if (pdev->pPortArray != NULL) {
-		ExFreePool(pdev->pPortArray);
+		ExFreePoolWithTag(pdev->pPortArray, 'pimw');
 	}
 
 	if (destroy) {
Index: core/winmad/kernel/wm_reg.c
===================================================================
--- core/winmad/kernel/wm_reg.c	(revision 2373)
+++ core/winmad/kernel/wm_reg.c	(working copy)
@@ -265,7 +265,7 @@
 {
 	WmRegRemoveHandler(pRegistatration);
 	WmProviderPut(pRegistatration->pProvider);
-	ExFreePool(pRegistatration);
+	ExFreePoolWithTag(pRegistatration, 'grmw');
 }
 
 void WmRegRemoveHandler(WM_REGISTRATION *pRegistration)
Index: core/winverbs/kernel/wv_cq.c
===================================================================
--- core/winverbs/kernel/wv_cq.c	(revision 2373)
+++ core/winverbs/kernel/wv_cq.c	(working copy)
@@ -128,7 +128,7 @@
 err2:
 	WdfObjectDelete(cq->Queue);
 err1:
-	ExFreePool(cq);
+	ExFreePoolWithTag(cq, 'qcvw');
 	return status;
 }
 
@@ -235,7 +235,7 @@
 	WdfObjectDelete(pCq->Queue);
 	WdfObjectDelete(pCq->ErrorQueue);
 	WvDevicePut(pCq->pDevice);
-	ExFreePool(pCq);
+	ExFreePoolWithTag(pCq, 'qcvw');
 }
 
 void WvCqResize(WV_PROVIDER *pProvider, WDFREQUEST Request)
Index: core/winverbs/kernel/wv_device.c
===================================================================
--- core/winverbs/kernel/wv_device.c	(revision 2386)
+++ core/winverbs/kernel/wv_device.c	(working copy)
@@ -187,7 +187,7 @@
 	ib_status = pDevice->pVerbs->query_ca(pDevice->pDevice->hDevice, attr,
 
&size, NULL);
 	if (ib_status != IB_SUCCESS) {
-		ExFreePool(attr);
+		ExFreePoolWithTag(attr, 'acvw');
 		attr = NULL;
 	}
 
@@ -208,7 +208,7 @@
 	}
 
 	pDevice->PortCount = attr->num_ports;
-	ExFreePool(attr);
+	ExFreePoolWithTag(attr, 'acvw');
 
 	pDevice->pPorts = ExAllocatePoolWithTag(NonPagedPool, sizeof(WV_PORT) *
 
pDevice->PortCount, 'cpvw');
@@ -388,7 +388,7 @@
 
 	WvDeviceFreePorts(pDevice);
 	WvProviderPut(pDevice->pProvider);
-	ExFreePool(pDevice);
+	ExFreePoolWithTag(pDevice, 'cdvw');
 }
 
 void WvDeviceRemoveHandler(WV_DEVICE *pDevice)
@@ -576,7 +576,7 @@
 
 	WvConvertDevAttr(attr, ca_attr);
 	outlen = sizeof(WV_IO_DEVICE_ATTRIBUTES);
-	ExFreePool(ca_attr);
+	ExFreePoolWithTag(ca_attr, 'acvw');
 
 complete:
 	WdfRequestCompleteWithInformation(Request, status, outlen);
@@ -625,7 +625,7 @@
 	outlen = sizeof(WV_IO_PORT_ATTRIBUTES);
 
 free:
-	ExFreePool(ca_attr);
+	ExFreePoolWithTag(ca_attr, 'acvw');
 complete:
 	WdfRequestCompleteWithInformation(Request, status, outlen);
 }
@@ -681,7 +681,7 @@
 	}
 
 free:
-	ExFreePool(ca_attr);
+	ExFreePoolWithTag(ca_attr, 'acvw');
 complete:
 	WdfRequestCompleteWithInformation(Request, status, outlen);
 }
@@ -737,7 +737,7 @@
 	}
 
 free:
-	ExFreePool(ca_attr);
+	ExFreePoolWithTag(ca_attr, 'acvw');
 complete:
 	WdfRequestCompleteWithInformation(Request, status, outlen);
 }
Index: core/winverbs/kernel/wv_ep.c
===================================================================
--- core/winverbs/kernel/wv_ep.c	(revision 2373)
+++ core/winverbs/kernel/wv_ep.c	(working copy)
@@ -104,7 +104,7 @@
 	return STATUS_SUCCESS;
 
 err:
-	ExFreePool(ep);
+	ExFreePoolWithTag(ep, 'pevw');
 	return status;
 }
 
@@ -191,7 +191,7 @@
 
 	WdfIoQueuePurgeSynchronously(pEndpoint->Queue);
 	WdfObjectDelete(pEndpoint->Queue);
-	ExFreePool(pEndpoint);
+	ExFreePoolWithTag(pEndpoint, 'pevw');
 }
 
 void WvEpQuery(WV_PROVIDER *pProvider, WDFREQUEST Request)
Index: core/winverbs/kernel/wv_pd.c
===================================================================
--- core/winverbs/kernel/wv_pd.c	(revision 2384)
+++ core/winverbs/kernel/wv_pd.c	(working copy)
@@ -101,7 +101,7 @@
 	return STATUS_SUCCESS;
 
 err:
-	ExFreePool(pd);
+	ExFreePoolWithTag(pd, 'dpvw');
 	return STATUS_UNSUCCESSFUL;
 }
 
@@ -233,7 +233,7 @@
 		}
 
 		cl_qmap_remove_item(&pPd->MrMap, &mr->Item);
-		ExFreePool(mr);
+		ExFreePoolWithTag(mr, 'rmvw');
 	}
 
 	if (pPd->hVerbsPd != NULL) {
@@ -241,7 +241,7 @@
 	}
 
 	WvDevicePut(pPd->pDevice);
-	ExFreePool(pPd);
+	ExFreePoolWithTag(pPd, 'dpvw');
 }
 
 void WvPdRemoveHandler(WV_PROTECTION_DOMAIN *pPd)
@@ -342,7 +342,7 @@
 	return;
 
 err3:
-	ExFreePool(mr);
+	ExFreePoolWithTag(mr, 'rmvw');
 err2:
 	WvPdRelease(pd);
 err1:
@@ -389,7 +389,7 @@
 		goto release;
 	}
 
-	ExFreePool(mr);
+	ExFreePoolWithTag(mr, 'rmvw');
 release:
 	WvPdRelease(pd);
 complete:
@@ -501,7 +501,7 @@
 	}
 
 	WvPdPut(pMw->pPd);
-	ExFreePool(pMw);
+	ExFreePoolWithTag(pMw, 'wmvw');
 }
 
 static void WvVerbsConvertAv(ib_av_attr_t *pVerbsAv, WV_IO_AV *pAv)
@@ -630,5 +630,5 @@
 	}
 
 	WvPdPut(pAh->pPd);
-	ExFreePool(pAh);
+	ExFreePoolWithTag(pAh, 'havw');
 }
Index: core/winverbs/kernel/wv_qp.c
===================================================================
--- core/winverbs/kernel/wv_qp.c	(revision 2373)
+++ core/winverbs/kernel/wv_qp.c	(working copy)
@@ -480,7 +480,7 @@
 err3:
 	WvQpCreateRelease(pProvider, qp);
 err2:
-	ExFreePool(qp);
+	ExFreePoolWithTag(qp, 'pqvw');
 err1:
 	WdfRequestComplete(Request, status);
 }
@@ -528,7 +528,7 @@
 		if (mc->hVerbsMc != NULL) {
 			pQp->pVerbs->detach_mcast(mc->hVerbsMc);
 		}
-		ExFreePool(mc);
+		ExFreePoolWithTag(mc, 'cmvw');
 	}
 
 	if (InterlockedDecrement(&pQp->Ref) > 0) {
@@ -545,7 +545,7 @@
 	WvCqPut(pQp->pReceiveCq);
 	WvCqPut(pQp->pSendCq);
 	WvPdPut(pQp->pPd);
-	ExFreePool(pQp);
+	ExFreePoolWithTag(pQp, 'pqvw');
 }
 
 void WvQpQuery(WV_PROVIDER *pProvider, WDFREQUEST Request)
@@ -669,7 +669,7 @@
 err3:
 	WvQpRelease(qp);
 err2:
-	ExFreePool(pmc);
+	ExFreePoolWithTag(pmc, 'cmvw');
 err1:
 	WdfRequestComplete(Request, status);
 }
@@ -707,7 +707,7 @@
 				qp->pVerbs->detach_mcast(pmc->hVerbsMc);
 			}
 
-			ExFreePool(pmc);
+			ExFreePoolWithTag(pmc, 'cmvw');
 			status = STATUS_SUCCESS;
 			goto release;
 		}
Index: core/winverbs/kernel/wv_srq.c
===================================================================
--- core/winverbs/kernel/wv_srq.c	(revision 2373)
+++ core/winverbs/kernel/wv_srq.c	(working copy)
@@ -133,7 +133,7 @@
 err2:
 	WdfObjectDelete(srq->Queue);
 err1:
-	ExFreePool(srq);
+	ExFreePoolWithTag(srq, 'rsvw');
 	return STATUS_UNSUCCESSFUL;
 }
 
@@ -239,7 +239,7 @@
 	WdfIoQueuePurgeSynchronously(pSrq->Queue);
 	WdfObjectDelete(pSrq->Queue);
 	WvPdPut(pSrq->pPd);
-	ExFreePool(pSrq);
+	ExFreePoolWithTag(pSrq, 'rsvw');
 }
 
 void WvSrqModify(WV_PROVIDER *pProvider, WDFREQUEST Request)
Index: etc/kernel/work_queue.c
===================================================================
--- etc/kernel/work_queue.c	(revision 2373)
+++ etc/kernel/work_queue.c	(working copy)
@@ -85,7 +85,7 @@
 	while (--i > 0) {
 		IoFreeWorkItem(pWorkQueue->TaskArray[i].pWorkItem);
 	}
-	ExFreePool(pWorkQueue->TaskArray);
+	ExFreePoolWithTag(pWorkQueue->TaskArray, 'ktqw');
 	return STATUS_INSUFFICIENT_RESOURCES;
 }
 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: wv-freepoolwithtag.patch
Type: application/octet-stream
Size: 7426 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20090827/e3c8b554/attachment.obj>


More information about the ofw mailing list