All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] IB/rxe: ODP: Fix missing umem_odp->umem_mutex unlock
@ 2025-12-26  9:41 Li Zhijian
  2025-12-27  1:05 ` Zhu Yanjun
  2025-12-30  9:28 ` Leon Romanovsky
  0 siblings, 2 replies; 5+ messages in thread
From: Li Zhijian @ 2025-12-26  9:41 UTC (permalink / raw)
  To: linux-rdma
  Cc: linux-kernel, zyjzyj2000, jgg, leon, Daisuke Matsuda, Li Zhijian

rxe_odp_map_range_and_lock() should unlock umem_odp->umem_mutex on error.

Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
---
 drivers/infiniband/sw/rxe/rxe_odp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_odp.c b/drivers/infiniband/sw/rxe/rxe_odp.c
index 8b6a8b064d3c..d22b08da2713 100644
--- a/drivers/infiniband/sw/rxe/rxe_odp.c
+++ b/drivers/infiniband/sw/rxe/rxe_odp.c
@@ -178,8 +178,10 @@ static int rxe_odp_map_range_and_lock(struct rxe_mr *mr, u64 iova, int length, u
 			return err;
 
 		need_fault = rxe_check_pagefault(umem_odp, iova, length);
-		if (need_fault)
+		if (need_fault) {
+			mutex_unlock(&umem_odp->umem_mutex);
 			return -EFAULT;
+		}
 	}
 
 	return 0;
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-12-30 15:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-26  9:41 [PATCH] IB/rxe: ODP: Fix missing umem_odp->umem_mutex unlock Li Zhijian
2025-12-27  1:05 ` Zhu Yanjun
2025-12-30  9:27   ` Leon Romanovsky
2025-12-30 15:24     ` Zhu Yanjun
2025-12-30  9:28 ` Leon Romanovsky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.