aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/qedr/main.c
diff options
context:
space:
mode:
authorLv Yunlong <[email protected]>2021-04-26 14:06:14 +0000
committerJason Gunthorpe <[email protected]>2021-04-27 18:22:29 +0000
commit34b39efa5ae82fc0ad0acc27653c12a56328dbbe (patch)
treea820f438285564302f2905d592049195d9be8513 /drivers/infiniband/hw/qedr/main.c
parentRDMA/siw: Fix a use after free in siw_alloc_mr (diff)
downloadkernel-34b39efa5ae82fc0ad0acc27653c12a56328dbbe.tar.gz
kernel-34b39efa5ae82fc0ad0acc27653c12a56328dbbe.zip
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: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lv Yunlong <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]> Acked-by: Devesh Sharma <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
Diffstat (limited to 'drivers/infiniband/hw/qedr/main.c')
0 files changed, 0 insertions, 0 deletions