[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANjDDBivHfZheoiiq-WxwAM2MEaeSaF_p2hXA1WR4AqiH32bpg@mail.gmail.com>
Date: Tue, 27 Apr 2021 11:06:24 +0530
From: Devesh Sharma <devesh.sharma@...adcom.com>
To: Leon Romanovsky <leon@...nel.org>
Cc: Lv Yunlong <lyl2019@...l.ustc.edu.cn>,
Selvin Xavier <selvin.xavier@...adcom.com>,
Somnath Kotur <somnath.kotur@...adcom.com>,
Sriharsha Basavapatna <sriharsha.basavapatna@...adcom.com>,
Naresh Kumar PBS <nareshkumar.pbs@...adcom.com>,
Doug Ledford <dledford@...hat.com>,
Jason Gunthorpe <jgg@...pe.ca>,
linux-rdma <linux-rdma@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] RDMA/bnxt_re/qplib_res: Fix a double free in bnxt_qplib_alloc_res
On Tue, Apr 27, 2021 at 10:21 AM Leon Romanovsky <leon@...nel.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@...l.ustc.edu.cn>
> > ---
> > drivers/infiniband/hw/bnxt_re/qplib_res.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
>
> Thanks,
> Reviewed-by: Leon Romanovsky <leonro@...dia.com>
Acked-By: Devesh Sharma <devesh.sharma@...adcom.com>
--
-Regards
Devesh
Download attachment "smime.p7s" of type "application/pkcs7-signature" (4212 bytes)
Powered by blists - more mailing lists