Skip to content

Commit f40f299

Browse files
skotur-brcmjgunthorpe
authored andcommitted
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: 1ac5a40 ("RDMA/bnxt_re: Add bnxt_re RoCE driver") Signed-off-by: Somnath Kotur <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 816e846 commit f40f299

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

drivers/infiniband/hw/bnxt_re/ib_verbs.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,8 @@ int bnxt_re_destroy_qp(struct ib_qp *ib_qp)
833833
"Failed to destroy Shadow QP");
834834
return rc;
835835
}
836+
bnxt_qplib_free_qp_res(&rdev->qplib_res,
837+
&rdev->qp1_sqp->qplib_qp);
836838
mutex_lock(&rdev->qp_lock);
837839
list_del(&rdev->qp1_sqp->list);
838840
atomic_dec(&rdev->qp_count);

drivers/infiniband/hw/bnxt_re/qplib_fp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ static int bnxt_qplib_alloc_qp_hdr_buf(struct bnxt_qplib_res *res,
196196
struct bnxt_qplib_qp *qp)
197197
{
198198
struct bnxt_qplib_q *rq = &qp->rq;
199-
struct bnxt_qplib_q *sq = &qp->rq;
199+
struct bnxt_qplib_q *sq = &qp->sq;
200200
int rc = 0;
201201

202202
if (qp->sq_hdr_buf_size && sq->hwq.max_elements) {

0 commit comments

Comments
 (0)