public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Prathamesh Deshpande <prathameshdeshpande7@gmail.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>,
	Haggai Eran <haggaie@mellanox.com>,
	Doug Ledford <dledford@redhat.com>,
	linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] IB/mlx5: Fix memory leak in GSI QP destroy error path
Date: Tue, 31 Mar 2026 16:45:08 +0300	[thread overview]
Message-ID: <20260331134508.GD814676@unreal> (raw)
In-Reply-To: <20260331004811.8851-1-prathameshdeshpande7@gmail.com>

On Tue, Mar 31, 2026 at 01:48:10AM +0100, Prathamesh Deshpande wrote:
> In mlx5_ib_destroy_gsi(), if the call to ib_destroy_qp() fails for
> the hardware receive QP (gsi->rx_qp), the function currently returns
> early. This results in a memory leak of the software resources
> (outstanding_wrs, tx_qps) and the 'gsi' structure itself.
> 
> Align the GSI destroy path with the 'best-effort' cleanup pattern. Even
> if the hardware fails to release the QP, proceed with the software
> cleanup to prevent orphan allocations.

GSI QP are different from other "best-effort" failures. It MUST to fail.
We are intentionally leaking resources here.

Thanks

  reply	other threads:[~2026-03-31 13:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-31  0:48 [PATCH] IB/mlx5: Fix memory leak in GSI QP destroy error path Prathamesh Deshpande
2026-03-31 13:45 ` Leon Romanovsky [this message]
2026-03-31 18:04   ` Prathamesh Deshpande

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260331134508.GD814676@unreal \
    --to=leon@kernel.org \
    --cc=dledford@redhat.com \
    --cc=haggaie@mellanox.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=prathameshdeshpande7@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox