diff mbox

[rdma-core,5/6] mlx4: Fix incorrect masking of g_mlpath_rqpn

Message ID 1491518545-14746-6-git-send-email-jgunthorpe@obsidianresearch.com (mailing list archive)
State Accepted
Headers show

Commit Message

Jason Gunthorpe April 6, 2017, 10:42 p.m. UTC
Two other places do this math and consensus is that MLX4_CQE_QPN_MASK
is in host endian, so this math is wrong. Found by sparse.

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
---
 providers/mlx4/cq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/providers/mlx4/cq.c b/providers/mlx4/cq.c
index 01d103d983eb4d..844e4da1305c63 100644
--- a/providers/mlx4/cq.c
+++ b/providers/mlx4/cq.c
@@ -739,7 +739,7 @@  void __mlx4_cq_clean(struct mlx4_cq *cq, uint32_t qpn, struct mlx4_srq *srq)
 		cqe = get_cqe(cq, prod_index & cq->ibv_cq.cqe);
 		cqe += cqe_inc;
 		if (srq && srq->ext_srq &&
-		    be32toh(cqe->g_mlpath_rqpn & MLX4_CQE_QPN_MASK) == srq->verbs_srq.srq_num &&
+		    (be32toh(cqe->g_mlpath_rqpn) & MLX4_CQE_QPN_MASK) == srq->verbs_srq.srq_num &&
 		    !(cqe->owner_sr_opcode & MLX4_CQE_IS_SEND_MASK)) {
 			mlx4_free_srq_wqe(srq, be16toh(cqe->wqe_index));
 			++nfreed;