diff mbox series

RDMA/vmw_pvrdma: Remove unnecessary check on wr->opcode

Message ID 20230605183728.47021-1-bryantan@vmware.com (mailing list archive)
State Accepted
Delegated to: Jason Gunthorpe
Headers show
Series RDMA/vmw_pvrdma: Remove unnecessary check on wr->opcode | expand

Commit Message

Bryan Tan June 5, 2023, 6:37 p.m. UTC
From: Bryan Tan <bryantan@vmware.com>

wr->opcode is unsigned; checking if it is negative is unnecessary.
Fix this issue by removing the check.

Fixes: 29c8d9eba550 ("IB: Add vmw_pvrdma driver")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Bryan Tan <bryantan@vmware.com>
---
 drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c | 8 --------
 1 file changed, 8 deletions(-)

Comments

Jason Gunthorpe June 9, 2023, 5:14 p.m. UTC | #1
On Mon, Jun 05, 2023 at 11:37:28AM -0700, bryantan@vmware.com wrote:
> From: Bryan Tan <bryantan@vmware.com>
> 
> wr->opcode is unsigned; checking if it is negative is unnecessary.
> Fix this issue by removing the check.
> 
> Fixes: 29c8d9eba550 ("IB: Add vmw_pvrdma driver")
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> Signed-off-by: Bryan Tan <bryantan@vmware.com>
> ---
>  drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c | 8 --------
>  1 file changed, 8 deletions(-)

Applied to for-next, thanks

Jason
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c
index f83cd4a9d992..98b2a0090bf2 100644
--- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c
+++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c
@@ -709,14 +709,6 @@  int pvrdma_post_send(struct ib_qp *ibqp, const struct ib_send_wr *wr,
 			goto out;
 		}
 
-		if (unlikely(wr->opcode < 0)) {
-			dev_warn_ratelimited(&dev->pdev->dev,
-					     "invalid send opcode\n");
-			*bad_wr = wr;
-			ret = -EINVAL;
-			goto out;
-		}
-
 		/*
 		 * Only support UD, RC.
 		 * Need to check opcode table for thorough checking.