linux/drivers/infiniband/hw/efa
Yonatan Nachum dc202c57e9 RDMA/efa: Fix wrong resources deallocation order
When trying to destroy QP or CQ, we first decrease the refcount and
potentially free memory regions allocated for the object and then
request the device to destroy the object. If the device fails, the
object isn't fully destroyed so the user/IB core can try to destroy the
object again which will lead to underflow when trying to decrease an
already zeroed refcount.

Deallocate resources in reverse order of allocating them to safely free
them.

Fixes: ff6629f88c ("RDMA/efa: Do not delay freeing of DMA pages")
Reviewed-by: Michael Margolin <mrgolin@amazon.com>
Reviewed-by: Yossi Leybovich <sleybo@amazon.com>
Signed-off-by: Yonatan Nachum <ynachum@amazon.com>
Link: https://lore.kernel.org/r/20230822082725.31719-1-ynachum@amazon.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
2023-08-22 17:21:53 +03:00
..
efa_admin_cmds_defs.h RDMA/efa: Add RDMA write HW statistics counters 2023-07-12 15:07:32 +03:00
efa_admin_defs.h RDMA/efa: CQ notifications 2021-10-06 19:47:18 -03:00
efa_com_cmd.c RDMA/efa: Add RDMA write HW statistics counters 2023-07-12 15:07:32 +03:00
efa_com_cmd.h RDMA/efa: Add RDMA write HW statistics counters 2023-07-12 15:07:32 +03:00
efa_com.c RDMA/efa: CQ notifications 2021-10-06 19:47:18 -03:00
efa_com.h RDMA/efa: CQ notifications 2021-10-06 19:47:18 -03:00
efa_common_defs.h RDMA/efa: Unified getters/setters for device structs bitmask access 2020-02-28 12:12:04 -04:00
efa_io_defs.h RDMA/efa: Add rdma write capability to device caps 2023-04-21 19:18:58 -03:00
efa_main.c RDMA/efa: Add EFA 0xefa2 PCI ID 2022-10-24 14:11:58 +03:00
efa_regs_defs.h RDMA/efa: CQ notifications 2021-10-06 19:47:18 -03:00
efa_verbs.c RDMA/efa: Fix wrong resources deallocation order 2023-08-22 17:21:53 +03:00
efa.h RDMA/efa: Add support for dmabuf memory regions 2021-10-28 08:58:26 -03:00
Kconfig RDMA/efa: Add driver to Kconfig/Makefile 2019-05-07 12:47:47 -03:00
Makefile RDMA/efa: Add driver to Kconfig/Makefile 2019-05-07 12:47:47 -03:00