diff mbox

[3/4] RDMA/libocrdma: un-map cqe memory in destroy_cq

Message ID 1392960704-10871-3-git-send-email-devesh.sharma@emulex.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Devesh Sharma Feb. 21, 2014, 5:31 a.m. UTC
From: Devesh Sharma <devesh.sharma@emulex.com>

while calling detroy cq, the host memory used to hold CQEs
needs to be unmapped.

Signed-off-by: Devesh Sharma <devesh.sharma@emulex.com>
Signed-off-by: Selvin Xavier <selvin.xavier@emulex.com>
---
 src/ocrdma_verbs.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/src/ocrdma_verbs.c b/src/ocrdma_verbs.c
index acf460f..96c5f78 100644
--- a/src/ocrdma_verbs.c
+++ b/src/ocrdma_verbs.c
@@ -356,9 +356,13 @@  int ocrdma_resize_cq(struct ibv_cq *ibcq, int new_entries)
 int ocrdma_destroy_cq(struct ibv_cq *ibv_cq)
 {
 	struct ocrdma_cq *cq = get_ocrdma_cq(ibv_cq);
+
 	ibv_cmd_destroy_cq(ibv_cq);
 	if (cq->db_va)
 		munmap((void *)cq->db_va, cq->db_size);
+	if (cq->va)
+		munmap((void*)cq->va, cq->cq_mem_size);
+
 	free(cq);
 	return 0;
 }