Skip to content

Commit ffa85a2

Browse files
prathameshdeshpande7gregkh
authored andcommitted
RDMA/mlx5: Fix UMR XLT cleanup on ODP populate failure
[ Upstream commit 1eae35b ] mlx5r_umr_update_xlt() allocates and DMA maps an XLT buffer with mlx5r_umr_create_xlt(). The buffer is released by the common cleanup path through mlx5r_umr_unmap_free_xlt(). After mlx5_odp_populate_xlt() became fallible, its error path returned directly and skipped that cleanup. This leaks the XLT DMA mapping and buffer. If the emergency XLT page was used, it also leaves xlt_emergency_page_mutex locked. Break out of the loop so execution falls through the existing cleanup path. Fixes: 1efe8c0 ("RDMA/core: Convert UMEM ODP DMA mapping to caching IOVA and page linkage") Signed-off-by: Prathamesh Deshpande <prathameshdeshpande7@gmail.com> Link: https://patch.msgid.link/20260426132356.22264-1-prathameshdeshpande7@gmail.com Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 2cd221f commit ffa85a2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • drivers/infiniband/hw/mlx5

drivers/infiniband/hw/mlx5/umr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,7 @@ int mlx5r_umr_update_xlt(struct mlx5_ib_mr *mr, u64 idx, int npages,
915915
*/
916916
err = mlx5_odp_populate_xlt(xlt, idx, npages, mr, flags);
917917
if (err)
918-
return err;
918+
break;
919919
dma_sync_single_for_device(ddev, sg.addr, sg.length,
920920
DMA_TO_DEVICE);
921921
sg.length = ALIGN(size_to_map, MLX5_UMR_FLEX_ALIGNMENT);

0 commit comments

Comments
 (0)