Target-devel archive on lore.kernel.org
 help / color / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Leon Romanovsky <leon@kernel.org>
Cc: Doug Ledford <dledford@redhat.com>,
	Maor Gottlieb <maorg@nvidia.com>,
	Bart Van Assche <bvanassche@acm.org>,
	linux-rdma@vger.kernel.org,
	"Nicholas A. Bellinger" <nab@risingtidesystems.com>,
	target-devel@vger.kernel.org
Subject: Re: [PATCH rdma-next v2] IB/srpt: Fix memory leak in srpt_add_one
Date: Mon, 02 Nov 2020 19:25:21 +0000
Message-ID: <20201102192521.GA3710231@nvidia.com> (raw)
In-Reply-To: <20201028065051.112430-1-leon@kernel.org>

On Wed, Oct 28, 2020 at 08:50:51AM +0200, Leon Romanovsky wrote:
> From: Maor Gottlieb <maorg@nvidia.com>
> 
> Failure in srpt_refresh_port() for the second port will leave MAD
> registered for the first one, however, the srpt_add_one() will be
> marked as "failed" and SRPT will leak resources for that registered
> but not used and released first port.
> 
> Unregister the MAD agent for all ports in case of failure.
> 
> Fixes: a42d985bd5b2 ("ib_srpt: Initial SRP Target merge for v3.3-rc1")
> Signed-off-by: Maor Gottlieb <maorg@nvidia.com>
> Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
> Reviewed-by: Bart Van Assche <bvanassche@acm.org>
> ---
> Changelog:
> v2:
>  * Added an extra parameter to srpt_unregister_mad_agent() to eliminate
>    an extra obfuscation call.
> v1:
> https://lore.kernel.org/linux-rdma/20201027055920.1760663-1-leon@kernel.org
>  * Fixed and updated commit message.
>  * Remove port_cnt check from __srpt_unregister_mad_agent().
> v0:
> https://lore.kernel.org/linux-rdma/20201026132737.1338171-1-leon@kernel.org
> ---
>  drivers/infiniband/ulp/srpt/ib_srpt.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)

Applied to for-rc, thanks

Jason

      parent reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-28  6:50 Leon Romanovsky
2020-10-29  3:31 ` Bart Van Assche
2020-11-02 19:25 ` Jason Gunthorpe [this message]

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=20201102192521.GA3710231@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=bvanassche@acm.org \
    --cc=dledford@redhat.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=maorg@nvidia.com \
    --cc=nab@risingtidesystems.com \
    --cc=target-devel@vger.kernel.org \
    /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

Target-devel archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/target-devel/0 target-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 target-devel target-devel/ https://lore.kernel.org/target-devel \
		target-devel@vger.kernel.org
	public-inbox-index target-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.target-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git