Commit f40f299b authored by Somnath Kotur's avatar Somnath Kotur Committed by Jason Gunthorpe

bnxt_re: Fix couple of memory leaks that could lead to IOMMU call traces

1. DMA-able memory allocated for Shadow QP was not being freed.
2. bnxt_qplib_alloc_qp_hdr_buf() had a bug wherein the SQ pointer was
   erroneously pointing to the RQ. But since the corresponding
   free_qp_hdr_buf() was correct, memory being free was less than what was
   allocated.

Fixes: 1ac5a404 ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
Signed-off-by: default avatarSomnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 816e846c
...@@ -833,6 +833,8 @@ int bnxt_re_destroy_qp(struct ib_qp *ib_qp) ...@@ -833,6 +833,8 @@ int bnxt_re_destroy_qp(struct ib_qp *ib_qp)
"Failed to destroy Shadow QP"); "Failed to destroy Shadow QP");
return rc; return rc;
} }
bnxt_qplib_free_qp_res(&rdev->qplib_res,
&rdev->qp1_sqp->qplib_qp);
mutex_lock(&rdev->qp_lock); mutex_lock(&rdev->qp_lock);
list_del(&rdev->qp1_sqp->list); list_del(&rdev->qp1_sqp->list);
atomic_dec(&rdev->qp_count); atomic_dec(&rdev->qp_count);
......
...@@ -196,7 +196,7 @@ static int bnxt_qplib_alloc_qp_hdr_buf(struct bnxt_qplib_res *res, ...@@ -196,7 +196,7 @@ static int bnxt_qplib_alloc_qp_hdr_buf(struct bnxt_qplib_res *res,
struct bnxt_qplib_qp *qp) struct bnxt_qplib_qp *qp)
{ {
struct bnxt_qplib_q *rq = &qp->rq; struct bnxt_qplib_q *rq = &qp->rq;
struct bnxt_qplib_q *sq = &qp->rq; struct bnxt_qplib_q *sq = &qp->sq;
int rc = 0; int rc = 0;
if (qp->sq_hdr_buf_size && sq->hwq.max_elements) { if (qp->sq_hdr_buf_size && sq->hwq.max_elements) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment