From 24f23935531e06167237b2d2e678dc879ae6feaf Mon Sep 17 00:00:00 2001 From: shefty Date: Thu, 1 May 2008 03:44:28 +0000 Subject: [PATCH] winverbs/cq: destroy IoQueue We need to cleanup the IoQueue when destroying the CQ. Signed-off-by: Sean Hefty git-svn-id: svn://openib.tc.cornell.edu/gen1@1100 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- branches/winverbs/core/winverbs/kernel/wv_cq.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/branches/winverbs/core/winverbs/kernel/wv_cq.c b/branches/winverbs/core/winverbs/kernel/wv_cq.c index aea525a0..cc8b5219 100644 --- a/branches/winverbs/core/winverbs/kernel/wv_cq.c +++ b/branches/winverbs/core/winverbs/kernel/wv_cq.c @@ -112,7 +112,7 @@ static NTSTATUS WvCqAlloc(WV_DEVICE *pDevice, UINT32 *pSize, status = WdfIoQueueCreate(ControlDevice, &config, WDF_NO_OBJECT_ATTRIBUTES, &cq->Queue); if (!NT_SUCCESS(status)) { - goto err; + goto err1; } ib_status = pDevice->pVerbs->create_cq(pDevice->hVerbsDevice, cq, @@ -120,14 +120,16 @@ static NTSTATUS WvCqAlloc(WV_DEVICE *pDevice, UINT32 *pSize, pSize, &cq->hVerbsCq, pVerbsData); if (ib_status != IB_SUCCESS) { status = STATUS_UNSUCCESSFUL; - goto err; + goto err2; } cq->pVerbs = pDevice->pVerbs; *ppCq = cq; return STATUS_SUCCESS; -err: +err2: + WdfObjectDelete(cq->Queue); +err1: ExFreePool(cq); return status; } @@ -230,6 +232,8 @@ void WvCqFree(WV_COMPLETION_QUEUE *pCq) pCq->pVerbs->destroy_cq(pCq->hVerbsCq); } + WdfIoQueuePurgeSynchronously(pCq->Queue); + WdfObjectDelete(pCq->Queue); WvDevicePut(pCq->pDevice); ExFreePool(pCq); } -- 2.41.0