From: Leon Romanovsky <leon@kernel.org>
To: Jianglei Nie <niejianglei2021@163.com>
Cc: mkalderon@marvell.com, aelior@marvell.com, jgg@ziepe.ca,
linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] RDMA/qedr: Fix potential memory leak in __qedr_alloc_mr()
Date: Mon, 18 Jul 2022 14:03:45 +0300 [thread overview]
Message-ID: <YtU+ETuEBVewKJQK@unreal> (raw)
In-Reply-To: <20220714061505.2342759-1-niejianglei2021@163.com>
On Thu, Jul 14, 2022 at 02:15:05PM +0800, Jianglei Nie wrote:
> __qedr_alloc_mr() allocates a memory chunk for "mr->info.pbl_table" with
> init_mr_info(). When rdma_alloc_tid() and rdma_register_tid() fail, "mr"
> is released while "mr->info.pbl_table" is not released, which will lead
> to a memory leak.
>
> We should release the "mr->info.pbl_table" with qedr_free_pbl() when error
> occurs to fix the memory leak.
>
> Signed-off-by: Jianglei Nie <niejianglei2021@163.com>
> ---
> drivers/infiniband/hw/qedr/verbs.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
Added fixes line.
Fixes: e0290cce6ac0 ("qedr: Add support for memory registeration verbs")
Thanks, applied.
prev parent reply other threads:[~2022-07-18 11:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-14 6:15 [PATCH] RDMA/qedr: Fix potential memory leak in __qedr_alloc_mr() Jianglei Nie
2022-07-14 10:17 ` [EXT] " Michal Kalderon
2022-07-18 11:03 ` Leon Romanovsky [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=YtU+ETuEBVewKJQK@unreal \
--to=leon@kernel.org \
--cc=aelior@marvell.com \
--cc=jgg@ziepe.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=mkalderon@marvell.com \
--cc=niejianglei2021@163.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.