Skip to content

Commit c57c764

Browse files
advait-0rleon
authored andcommitted
RDMA/erdma: Fix opcode conditional check
Fix conditional if else check by checking with wr->opcode. The indicated dead code may have performed some action; that action will never occur as op is pre-assigned a different value. Fixes: 999a0a2 ("RDMA/erdma: Support UD QPs and UD WRs") Signed-off-by: Advait Dhamorikar <advaitdhamorikar@gmail.com> Link: https://patch.msgid.link/20241219043939.10344-1-advaitdhamorikar@gmail.com Reviewed-by: Cheng Xu <chengyou@linux.alibaba.com> Signed-off-by: Leon Romanovsky <leon@kernel.org>
1 parent a3cbf68 commit c57c764

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/infiniband/hw/erdma/erdma_qp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ static void init_send_sqe_rc(struct erdma_qp *qp, struct erdma_send_sqe_rc *sqe,
406406
if (wr->opcode == IB_WR_SEND_WITH_IMM) {
407407
op = ERDMA_OP_SEND_WITH_IMM;
408408
sqe->imm_data = wr->ex.imm_data;
409-
} else if (op == IB_WR_SEND_WITH_INV) {
409+
} else if (wr->opcode == IB_WR_SEND_WITH_INV) {
410410
op = ERDMA_OP_SEND_WITH_INV;
411411
sqe->invalid_stag = cpu_to_le32(wr->ex.invalidate_rkey);
412412
}

0 commit comments

Comments
 (0)