]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
RDMA/irdma: Fix positive vs negative error codes in irdma_post_send()
authorDan Carpenter <dan.carpenter@linaro.org>
Tue, 23 Sep 2025 11:20:45 +0000 (14:20 +0300)
committerJason Gunthorpe <jgg@nvidia.com>
Wed, 24 Sep 2025 13:52:43 +0000 (10:52 -0300)
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>
drivers/infiniband/hw/irdma/verbs.c

index a47ccc86e485ed7c602f41bc6f20c87ac932ee87..3e5196ee61efa76261a13ea40a11ffc6cd6b626c 100644 (file)
@@ -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;