lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241219043939.10344-1-advaitdhamorikar@gmail.com>
Date: Thu, 19 Dec 2024 10:09:39 +0530
From: Advait Dhamorikar <advaitdhamorikar@...il.com>
To: Cheng Xu <chengyou@...ux.alibaba.com>,
	Kai Shen <kaishen@...ux.alibaba.com>,
	Jason Gunthorpe <jgg@...pe.ca>,
	Leon Romanovsky <leon@...nel.org>
Cc: linux-rdma@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Advait Dhamorikar <advaitdhamorikar@...il.com>
Subject: [PATCH-next] 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.

Signed-off-by: Advait Dhamorikar <advaitdhamorikar@...il.com>
---
 drivers/infiniband/hw/erdma/erdma_qp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/erdma/erdma_qp.c b/drivers/infiniband/hw/erdma/erdma_qp.c
index 4dfb4272ad86..5c266918fb36 100644
--- a/drivers/infiniband/hw/erdma/erdma_qp.c
+++ b/drivers/infiniband/hw/erdma/erdma_qp.c
@@ -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);
 	}
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ