Skip to content

Commit e23cb0a

Browse files
committed
mlx5: Fix byte_count type in umr_sg_list_create
Change byte_count variable from int to uint64_t to match the reglen parameter type and prevent potential overflow issues when working with large memory registrations in UMR (User-Mode Memory Registration) operations. The function signature uses uint64_t *reglen, but byte_count was declared as int, which could cause type mismatch issues and potential overflow when accumulating large transfer sizes across multiple SGEs. Signed-off-by: Dennis van der Staay <dstaay@fb.com>
1 parent 247966c commit e23cb0a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

providers/mlx5/qp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2106,7 +2106,7 @@ static int umr_sg_list_create(struct mlx5_qp *qp,
21062106
uint64_t *reglen)
21072107
{
21082108
struct mlx5_wqe_data_seg *dseg;
2109-
int byte_count = 0;
2109+
uint64_t byte_count = 0;
21102110
int i;
21112111
size_t tmp;
21122112

0 commit comments

Comments
 (0)