Skip to contentSkip to conversation

RDMA/irdma: Fix positive vs negative error codes in irdma_post_send()

PATCH Applied Dan Carpenter 2 participants 2 messages Sep 23, 2025 – Sep 24, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA/irdma: Fix positive vs negative error codes in irdma_post_send()

This code accidentally returns positive EINVAL instead of negative -EINVAL. Some of the callers treat positive returns as success. Add the missing '-' char.

Fixes a24a29c8747f ("RDMA/irdma: Add Atomic Operations support")
---
 drivers/infiniband/hw/irdma/verbs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/hw/irdma/verbs.c +2 -2
index 24f9503f410f..f9d9157029ac 100644
@@ -3966,7 +3966,7 @@ static int irdma_post_send(struct ib_qp *ibqp,
 		case IB_WR_ATOMIC_CMP_AND_SWP:
 			if (unlikely(!(dev->hw_attrs.uk_attrs.feature_flags &
 				       IRDMA_FEATURE_ATOMIC_OPS))) {
-				err = EINVAL;
+				err = -EINVAL;
 				break;
 			}
 			info.op_type = IRDMA_OP_TYPE_ATOMIC_COMPARE_AND_SWAP;
@@ -3983,7 +3983,7 @@ static int irdma_post_send(struct ib_qp *ibqp,
 		case IB_WR_ATOMIC_FETCH_AND_ADD:
 			if (unlikely(!(dev->hw_attrs.uk_attrs.feature_flags &
 				       IRDMA_FEATURE_ATOMIC_OPS))) {
-				err = EINVAL;
+				err = -EINVAL;
 				break;
 			}
 			info.op_type = IRDMA_OP_TYPE_ATOMIC_FETCH_AND_ADD;
Signature · 1 line
2.51.0
maintainer Applied
#1 lore raw
Quoted 9 lines · Dan Carpenter

This code accidentally returns positive EINVAL instead of negative -EINVAL. Some of the callers treat positive returns as success. Add the missing '-' char.

Fixes a24a29c8747f ("RDMA/irdma: Add Atomic Operations support")
---
 drivers/infiniband/hw/irdma/verbs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Applied to for-next, thanks

Jason