]> www.infradead.org Git - linux.git/commitdiff
RDMA/erdma: Fix opcode conditional check
authorAdvait Dhamorikar <advaitdhamorikar@gmail.com>
Thu, 19 Dec 2024 04:39:39 +0000 (10:09 +0530)
committerLeon Romanovsky <leon@kernel.org>
Thu, 19 Dec 2024 12:16:31 +0000 (07:16 -0500)
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: 999a0a2e9b87 ("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>
drivers/infiniband/hw/erdma/erdma_qp.c

index 4dfb4272ad869ee351649c2ce62e5eb4b5be475e..5c266918fb36dea8a52f2bebea35b4d7f4d72dd2 100644 (file)
@@ -406,7 +406,7 @@ static void init_send_sqe_rc(struct erdma_qp *qp, struct erdma_send_sqe_rc *sqe,
        if (wr->opcode == IB_WR_SEND_WITH_IMM) {
                op = ERDMA_OP_SEND_WITH_IMM;
                sqe->imm_data = wr->ex.imm_data;
-       } else if (op == IB_WR_SEND_WITH_INV) {
+       } else if (wr->opcode == IB_WR_SEND_WITH_INV) {
                op = ERDMA_OP_SEND_WITH_INV;
                sqe->invalid_stag = cpu_to_le32(wr->ex.invalidate_rkey);
        }