TencentOS-kernel/drivers/infiniband/hw
Lv Yunlong 7bf4a0f55e RDMA/bnxt_re: Fix a double free in bnxt_qplib_alloc_res
[ Upstream commit 34b39efa5ae82fc0ad0acc27653c12a56328dbbe ]

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: 1ac5a4047975 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-05-20 16:08:01 +08:00
..
bnxt_re RDMA/bnxt_re: Fix a double free in bnxt_qplib_alloc_res 2021-05-20 16:08:01 +08:00
cxgb3 Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
cxgb4 RDMA/cxgb4: add missing qpid increment 2021-05-20 16:07:59 +08:00
efa Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
hfi1 IB/hfi1: Fix error return code in parse_platform_config() 2021-05-20 16:07:56 +08:00
hns RDMA/hns: Fixes missing error code of CMDQ 2021-04-12 12:52:29 +08:00
i40iw RDMA/i40iw: Fix error unwinding when i40iw_hmc_sd_one fails 2021-05-20 16:07:59 +08:00
mlx4 IB/mlx4: Adjust delayed work when a dup is observed 2021-03-16 16:38:48 +08:00
mlx5 IB/mlx5: Add missing error code 2021-04-12 12:52:52 +08:00
mthca RDMa/mthca: Work around -Wenum-conversion warning 2021-03-16 16:42:45 +08:00
ocrdma RDMA/ocrdma: Fix use after free in ocrdma_dealloc_ucontext_pd() 2021-04-12 12:51:22 +08:00
qedr RDMA/qedr: Fix error return code in qedr_iw_connect() 2021-05-20 16:07:57 +08:00
qib IB/qib: Call kobject_put() when kobject_init_and_add() fails 2021-03-16 16:28:33 +08:00
usnic RDMA/usnic: Fix memleak in find_free_vf_and_create_qp_grp 2021-04-12 12:51:27 +08:00
vmw_pvrdma RDMA/pvrdma: Fix missing kfree() in pvrdma_register_device() 2021-03-16 16:41:16 +08:00
Makefile Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00