Skip to content

Commit 3c68cf6

Browse files
zhijianli88rleon
authored andcommitted
IB/rxe: Fix missing umem_odp->umem_mutex unlock on error path
rxe_odp_map_range_and_lock() must release umem_odp->umem_mutex when an error occurs, including cases where rxe_check_pagefault() fails. Fixes: 2fae67a ("RDMA/rxe: Add support for Send/Recv/Write/Read with ODP") Signed-off-by: Li Zhijian <lizhijian@fujitsu.com> Link: https://patch.msgid.link/20251226094112.3042583-1-lizhijian@fujitsu.com Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev> Signed-off-by: Leon Romanovsky <leon@kernel.org>
1 parent 3d70e0f commit 3c68cf6

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/infiniband/sw/rxe/rxe_odp.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,10 @@ static int rxe_odp_map_range_and_lock(struct rxe_mr *mr, u64 iova, int length, u
179179
return err;
180180

181181
need_fault = rxe_check_pagefault(umem_odp, iova, length);
182-
if (need_fault)
182+
if (need_fault) {
183+
mutex_unlock(&umem_odp->umem_mutex);
183184
return -EFAULT;
185+
}
184186
}
185187

186188
return 0;

0 commit comments

Comments
 (0)