summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@linaro.org>2025-09-23 14:20:45 +0300
committerJason Gunthorpe <jgg@nvidia.com>2025-09-24 10:52:43 -0300
commit4bab6d9584497191c449212c85799de4d84a1263 (patch)
treeffa6a111ec09e3cf0a080b7e6cd327ff506f0383
parent7fcf00bd7f30540cf7096c8f2fadab5d890d4cf2 (diff)
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") Link: https://patch.msgid.link/r/aNKCjcD6Nab1jWEV@stanley.mountain Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
-rw-r--r--drivers/infiniband/hw/irdma/verbs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c
index a47ccc86e485..3e5196ee61ef 100644
--- a/drivers/infiniband/hw/irdma/verbs.c
+++ b/drivers/infiniband/hw/irdma/verbs.c
@@ -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;