OpenCloudOS-Kernel/drivers/infiniband/hw/bnxt_re
Lv Yunlong 34b39efa5a RDMA/bnxt_re: Fix a double free in bnxt_qplib_alloc_res
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 the 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: 1ac5a40479 ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
Link: https://lore.kernel.org/r/20210426140614.6722-1-lyl2019@mail.ustc.edu.cn
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>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2021-04-27 15:22:29 -03:00
..
Kconfig RDMA/bnxt_re: Depend on bnxt ethernet driver and not blindly select it 2021-04-19 14:57:03 -03:00
Makefile
bnxt_re.h
hw_counters.c
hw_counters.h
ib_verbs.c
ib_verbs.h
main.c RDMA/bnxt_re: Get rid of custom module reference counting 2021-04-19 14:57:03 -03:00
qplib_fp.c RDMA/bnxt_re: Fix error return code in bnxt_qplib_cq_process_terminal() 2021-04-12 15:11:00 -03:00
qplib_fp.h
qplib_rcfw.c
qplib_rcfw.h
qplib_res.c RDMA/bnxt_re: Fix a double free in bnxt_qplib_alloc_res 2021-04-27 15:22:29 -03:00
qplib_res.h
qplib_sp.c
qplib_sp.h
roce_hsi.h