[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250918100205.GE10800@unreal>
Date: Thu, 18 Sep 2025 13:02:05 +0300
From: Leon Romanovsky <leon@...nel.org>
To: YanLong Dai <dyl_wlc@....com>
Cc: kalesh-anakkur.purayil@...adcom.com, jgg@...pe.ca,
linux-kernel@...r.kernel.org, linux-rdma@...r.kernel.org,
selvin.xavier@...adcom.com, daiyanlong@...inos.cn
Subject: Re: [PATCH] drivers: fix the potential memory leak in
bnxt_re_destroy_gsi_sqp()
On Wed, Sep 17, 2025 at 07:35:39PM +0800, YanLong Dai wrote:
> From: daiyanlong <daiyanlong@...inos.cn>
>
> As suggested by Kalesh Anakkur Purayil, fix the potential memory leak in bnxt_re_destroy_gsi_sqp() by continuing the teardown even if bnxt_qplib_destroy_qp() fails, we should not fail the resource destroy operations
>
> Signed-off-by: daiyanlong <daiyanlong@...inos.cn>
> ---
> drivers/infiniband/hw/bnxt_re/ib_verbs.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
Please resend this patch as standalone and not as Reply-to to other conversion.
While you are doing that, make sure that your patch pass checkpatch.pl, break lines
in commit message, use real name in Signed-off-by and From fields, and
remove "rc" variable too, which is not used.
Thanks
>
> diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> index 260dc67b8b87..adee44aa0583 100644
> --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> @@ -931,10 +931,9 @@ static int bnxt_re_destroy_gsi_sqp(struct bnxt_re_qp *qp)
>
> ibdev_dbg(&rdev->ibdev, "Destroy the shadow QP\n");
> rc = bnxt_qplib_destroy_qp(&rdev->qplib_res, &gsi_sqp->qplib_qp);
> - if (rc) {
> + if (rc)
> ibdev_err(&rdev->ibdev, "Destroy Shadow QP failed");
> - goto fail;
> - }
> +
> bnxt_qplib_free_qp_res(&rdev->qplib_res, &gsi_sqp->qplib_qp);
>
> /* remove from active qp list */
> --
> 2.43.0
>
>
Powered by blists - more mailing lists