diff options
author | Somnath Kotur <somnath.kotur@broadcom.com> | 2018-09-05 03:50:34 -0400 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-09-05 18:08:41 -0400 |
commit | f40f299bbe806a2e2c8b0d7cdda822fa3bdd171b (patch) | |
tree | 269428453e6e03967554047056acf8d578cd4115 | |
parent | 816e846c2eb9129a3e0afa5f920c8bbc71efecaa (diff) |
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: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
-rw-r--r-- | drivers/infiniband/hw/bnxt_re/ib_verbs.c | 2 | ||||
-rw-r--r-- | drivers/infiniband/hw/bnxt_re/qplib_fp.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c index bbfb86eb2d24..bc2b9e038439 100644 --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c | |||
@@ -833,6 +833,8 @@ int bnxt_re_destroy_qp(struct ib_qp *ib_qp) | |||
833 | "Failed to destroy Shadow QP"); | 833 | "Failed to destroy Shadow QP"); |
834 | return rc; | 834 | return rc; |
835 | } | 835 | } |
836 | bnxt_qplib_free_qp_res(&rdev->qplib_res, | ||
837 | &rdev->qp1_sqp->qplib_qp); | ||
836 | mutex_lock(&rdev->qp_lock); | 838 | mutex_lock(&rdev->qp_lock); |
837 | list_del(&rdev->qp1_sqp->list); | 839 | list_del(&rdev->qp1_sqp->list); |
838 | atomic_dec(&rdev->qp_count); | 840 | atomic_dec(&rdev->qp_count); |
diff --git a/drivers/infiniband/hw/bnxt_re/qplib_fp.c b/drivers/infiniband/hw/bnxt_re/qplib_fp.c index e426b990c1dd..6ad0d46ab879 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_fp.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.c | |||
@@ -196,7 +196,7 @@ static int bnxt_qplib_alloc_qp_hdr_buf(struct bnxt_qplib_res *res, | |||
196 | struct bnxt_qplib_qp *qp) | 196 | struct bnxt_qplib_qp *qp) |
197 | { | 197 | { |
198 | struct bnxt_qplib_q *rq = &qp->rq; | 198 | struct bnxt_qplib_q *rq = &qp->rq; |
199 | struct bnxt_qplib_q *sq = &qp->rq; | 199 | struct bnxt_qplib_q *sq = &qp->sq; |
200 | int rc = 0; | 200 | int rc = 0; |
201 | 201 | ||
202 | if (qp->sq_hdr_buf_size && sq->hwq.max_elements) { | 202 | if (qp->sq_hdr_buf_size && sq->hwq.max_elements) { |