linux/drivers/infiniband/sw
Li Zhijian 8ff5f5d9d8 RDMA/rxe: Prevent double freeing rxe_map_set()
The same rxe_map_set could be freed twice:

rxe_reg_user_mr()
  -> rxe_mr_init_user()
    -> rxe_mr_free_map_set() # 1st

  -> rxe_drop_ref()
   ...
    -> rxe_mr_cleanup()
      -> rxe_mr_free_map_set() # 2nd

Follow normal convection and put resource cleanup either in the error
unwind of the allocator, or the overall free function. Leave the object
unchanged with a NULL cur_map_set on failure and remove the unncessary
free in rxe_mr_init_user().

Link: https://lore.kernel.org/r/20211228014406.1033444-1-lizhijian@cn.fujitsu.com
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
Acked-by: Zhu Yanjun <zyjzyj2000@gmail.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2022-01-04 10:29:34 -04:00
..
rdmavt RDMA/rdmavt: Fix error code in rvt_create_qp() 2021-10-13 13:59:47 -03:00
rxe RDMA/rxe: Prevent double freeing rxe_map_set() 2022-01-04 10:29:34 -04:00
siw RDMA: Remove redundant 'flush_workqueue()' calls 2021-10-12 13:21:23 -03:00
Makefile rdma/siw: addition to kernel build environment 2019-07-02 17:03:41 -03:00