Jianglei Nie aa2a1df3a2 RDMA/hfi1: fix potential memory leak in setup_base_ctxt()
setup_base_ctxt() allocates a memory chunk for uctxt->groups with
hfi1_alloc_ctxt_rcv_groups(). When init_user_ctxt() fails, uctxt->groups
is not released, which will lead to a memory leak.

We should release the uctxt->groups with hfi1_free_ctxt_rcv_groups()
when init_user_ctxt() fails.

Fixes: e87473bc1b6c ("IB/hfi1: Only set fd pointer when base context is completely initialized")
Link: https://lore.kernel.org/r/20220711070718.2318320-1-niejianglei2021@163.com
Signed-off-by: Jianglei Nie <niejianglei2021@163.com>
Acked-by: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
2022-07-19 08:21:29 +03:00
..
2019-06-28 22:34:26 -03:00
2021-08-25 14:56:48 -03:00
2021-12-07 13:22:54 -04:00
2021-08-25 14:56:48 -03:00
2021-08-25 14:56:48 -03:00
2022-05-24 11:24:57 -03:00
2021-08-25 14:56:48 -03:00
2021-08-25 14:56:48 -03:00
2021-08-25 14:56:48 -03:00
2021-08-25 14:56:48 -03:00
2021-08-25 14:56:48 -03:00
2021-08-25 14:56:48 -03:00
2021-08-25 14:56:48 -03:00
2020-05-21 11:23:56 -03:00
2022-07-18 13:40:38 +03:00
2021-08-25 14:56:48 -03:00
2021-08-25 14:56:48 -03:00
2021-08-25 14:56:48 -03:00
2021-08-25 14:56:48 -03:00
2021-08-25 14:56:48 -03:00
2019-02-05 18:07:43 -05:00
2019-04-24 11:31:49 -03:00
2021-08-25 14:56:48 -03:00
2022-06-07 11:57:26 +03:00
2021-08-25 14:56:48 -03:00
2021-08-25 14:56:48 -03:00
2021-08-25 14:56:48 -03:00
2021-08-25 14:56:48 -03:00
2021-08-25 14:56:48 -03:00
2021-08-25 14:56:48 -03:00
2021-08-25 14:56:48 -03:00
2021-08-25 14:56:48 -03:00
2021-08-25 14:56:48 -03:00
2021-07-30 10:06:08 -03:00
2021-09-08 08:33:04 -03:00
2021-08-25 14:56:48 -03:00
2021-08-25 14:56:48 -03:00
2021-08-25 14:56:48 -03:00
2021-08-25 14:56:48 -03:00
2021-08-25 14:56:48 -03:00