Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6ebacdfc authored by Dan Carpenter's avatar Dan Carpenter Committed by Roland Dreier
Browse files

RDMA/ocrdma: Silence an integer underflow warning



We recently added a cap on "max_wqe_allocated" in 43a6b402
('RDMA/ocrdma: Create IRD queue fix').

My static checker complains that the cap has a problem because it
casts large values to negative.  "attrs->cap.max_send_wr" is a u32.
It comes from the user, but it's capped in ocrdma_check_qp_params() so
it can't wrap here.

Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent 959f5854
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1783,7 +1783,7 @@ static int ocrdma_set_create_qp_sq_cmd(struct ocrdma_create_qp_req *cmd,
	u32 max_sges = attrs->cap.max_send_sge;

	/* QP1 may exceed 127 */
	max_wqe_allocated = min_t(int, attrs->cap.max_send_wr + 1,
	max_wqe_allocated = min_t(u32, attrs->cap.max_send_wr + 1,
				dev->attr.max_wqe);

	status = ocrdma_build_q_conf(&max_wqe_allocated,