From: Leon Romanovsky <leon@kernel.org>
To: Guangshuo Li <liguangshuo@mail.sdu.edu.cn>
Cc: Selvin Xavier <selvin.xavier@broadcom.com>,
Jason Gunthorpe <jgg@ziepe.ca>,
linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] RDMA/ocrdma: Fix potential EQ table leak
Date: Mon, 16 Nov 2026 13:55:53 +0200 [thread overview]
Message-ID: <20261116115553.GJ11319@unreal> (raw)
In-Reply-To: <20261112-88a3a7ff32-rdma-ocrdma@mail.sdu.edu.cn>
On Thu, Nov 12, 2026 at 09:59:12PM +0800, Guangshuo Li wrote:
> EQ teardown destroys the individual queues but leaves their dynamically
> allocated table behind. Free the table after all EQs have been destroyed
> and reset its pointer and count.
>
> This issue was found by our static analysis tool under development.
>
> Fixes: fe2caefcdf58 ("RDMA/ocrdma: Add driver for Emulex OneConnect IBoE RDMA adapter")
> Signed-off-by: Guangshuo Li <liguangshuo@mail.sdu.edu.cn>
> ---
> drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
> index 006ef2e6b5f3..4a977281a85b 100644
> --- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
> +++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
> @@ -518,6 +518,9 @@ static void ocrdma_destroy_eqs(struct ocrdma_dev *dev)
>
> for (i = 0; i < dev->eq_cnt; i++)
> ocrdma_destroy_eq(dev, &dev->eq_tbl[i]);
> + kfree(dev->eq_tbl);
> + dev->eq_tbl = NULL;
> + dev->eq_cnt = 0;
These two lines are unnecessary because dev->eq_tbl is not reused.
Thanks
> }
>
> static int ocrdma_mbx_mq_cq_create(struct ocrdma_dev *dev,
>
> base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
prev parent reply other threads:[~2026-11-16 11:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 13:59 [PATCH] RDMA/ocrdma: Fix potential EQ table leak Guangshuo Li
2026-11-12 14:10 ` sashiko-bot
2026-11-16 11:55 ` Leon Romanovsky
2026-11-16 11:55 ` 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=20261116115553.GJ11319@unreal \
--to=leon@kernel.org \
--cc=jgg@ziepe.ca \
--cc=liguangshuo@mail.sdu.edu.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=selvin.xavier@broadcom.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