1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/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
..
bnxt_re.h RDMA/bnxt_re: Move device to error state upon device crash 2021-03-26 10:37:01 -03:00
hw_counters.c RDMA: Support more than 255 rdma ports 2021-03-26 09:31:21 -03:00
hw_counters.h RDMA: Support more than 255 rdma ports 2021-03-26 09:31:21 -03:00
ib_verbs.c RDMA: Support more than 255 rdma ports 2021-03-26 09:31:21 -03:00
ib_verbs.h RDMA: Support more than 255 rdma ports 2021-03-26 09:31:21 -03:00
Kconfig RDMA/bnxt_re: Depend on bnxt ethernet driver and not blindly select it 2021-04-19 14:57:03 -03:00
main.c RDMA/bnxt_re: Get rid of custom module reference counting 2021-04-19 14:57:03 -03:00
Makefile infiniband: prefix header search paths with $(srctree)/ 2019-01-25 15:28:50 -07: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 RDMA/bnxt_re: Change wr posting logic to accommodate variable wqes 2020-07-20 16:32:50 -03:00
qplib_rcfw.c RDMA/bnxt_re: Move device to error state upon device crash 2021-03-26 10:37:01 -03:00
qplib_rcfw.h RDMA/bnxt_re: Move device to error state upon device crash 2021-03-26 10:37:01 -03:00
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 RDMA/bnxt_re: Use rdma_umem_for_each_dma_block() 2020-10-06 16:45:53 -03:00
qplib_sp.c RDMA/bnxt_re: Allow bigger MR creation 2021-01-18 16:56:09 -04:00
qplib_sp.h RDMA/bnxt_re: Code refactor while populating user MRs 2021-01-18 16:56:08 -04:00
roce_hsi.h RDMA/bnxt_re: Add helper data structures 2020-07-20 16:32:50 -03:00