From: Jason Gunthorpe <jgg@nvidia.com>
To: Lv Yunlong <lyl2019@mail.ustc.edu.cn>
Cc: selvin.xavier@broadcom.com, devesh.sharma@broadcom.com,
somnath.kotur@broadcom.com, sriharsha.basavapatna@broadcom.com,
nareshkumar.pbs@broadcom.com, dledford@redhat.com,
linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] RDMA/bnxt_re/qplib_res: Fix a double free in bnxt_qplib_alloc_res
Date: Tue, 27 Apr 2021 15:31:59 -0300 [thread overview]
Message-ID: <20210427183159.GB3246473@nvidia.com> (raw)
In-Reply-To: <20210426140614.6722-1-lyl2019@mail.ustc.edu.cn>
On Mon, Apr 26, 2021 at 07:06:14AM -0700, Lv Yunlong wrote:
> In bnxt_qplib_alloc_res, it calls bnxt_qplib_alloc_dpi_tbl().
> Inside bnxt_qplib_alloc_dpi_tbl, dpit->dbr_bar_reg_iomem is freed via
> pci_iounmap() in unmap_io error branch. After the callee returns err code,
> bnxt_qplib_alloc_res calls bnxt_qplib_free_res()->bnxt_qplib_free_dpi_tbl()
> in fail branch. Then dpit->dbr_bar_reg_iomem is freed in the second time by
> pci_iounmap().
>
> My patch set dpit->dbr_bar_reg_iomem to NULL after it is freed by pci_iounmap()
> in the first time, to avoid the double free.
>
> Fixes: 1ac5a40479752 ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
> Signed-off-by: Lv Yunlong <lyl2019@mail.ustc.edu.cn>
> Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
> Acked-By: Devesh Sharma <devesh.sharma@broadcom.com>
> ---
> drivers/infiniband/hw/bnxt_re/qplib_res.c | 1 +
> 1 file changed, 1 insertion(+)
Applied to for-next, thanks
Jason
prev parent reply other threads:[~2021-04-27 18:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-26 14:06 [PATCH] RDMA/bnxt_re/qplib_res: Fix a double free in bnxt_qplib_alloc_res Lv Yunlong
2021-04-27 4:51 ` Leon Romanovsky
2021-04-27 5:36 ` Devesh Sharma
2021-04-27 18:31 ` 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=20210427183159.GB3246473@nvidia.com \
--to=jgg@nvidia.com \
--cc=devesh.sharma@broadcom.com \
--cc=dledford@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=lyl2019@mail.ustc.edu.cn \
--cc=nareshkumar.pbs@broadcom.com \
--cc=selvin.xavier@broadcom.com \
--cc=somnath.kotur@broadcom.com \
--cc=sriharsha.basavapatna@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