From: Devesh Sharma <devesh.sharma@broadcom.com>
To: Leon Romanovsky <leon@kernel.org>
Cc: Lv Yunlong <lyl2019@mail.ustc.edu.cn>,
Selvin Xavier <selvin.xavier@broadcom.com>,
Somnath Kotur <somnath.kotur@broadcom.com>,
Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>,
Naresh Kumar PBS <nareshkumar.pbs@broadcom.com>,
Doug Ledford <dledford@redhat.com>,
Jason Gunthorpe <jgg@ziepe.ca>,
linux-rdma <linux-rdma@vger.kernel.org>,
LKML <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 11:06:24 +0530 [thread overview]
Message-ID: <CANjDDBivHfZheoiiq-WxwAM2MEaeSaF_p2hXA1WR4AqiH32bpg@mail.gmail.com> (raw)
In-Reply-To: <YIeYUD5iWv/TI3PH@unreal>
[-- Attachment #1: Type: text/plain, Size: 1040 bytes --]
On Tue, Apr 27, 2021 at 10:21 AM Leon Romanovsky <leon@kernel.org> wrote:
>
> 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>
> > ---
> > drivers/infiniband/hw/bnxt_re/qplib_res.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
>
> Thanks,
> Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Acked-By: Devesh Sharma <devesh.sharma@broadcom.com>
--
-Regards
Devesh
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4212 bytes --]
next prev parent reply other threads:[~2021-04-27 5:37 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 [this message]
2021-04-27 18:31 ` Jason Gunthorpe
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=CANjDDBivHfZheoiiq-WxwAM2MEaeSaF_p2hXA1WR4AqiH32bpg@mail.gmail.com \
--to=devesh.sharma@broadcom.com \
--cc=dledford@redhat.com \
--cc=jgg@ziepe.ca \
--cc=leon@kernel.org \
--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 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.