From: Dan Carpenter <dan.carpenter@linaro.org>
To: Faisal Latif <faisal.latif@intel.com>
Cc: Tatyana Nikolova <tatyana.e.nikolova@intel.com>,
Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: [PATCH next] RDMA/irdma: Fix positive vs negative error codes in irdma_post_send()
Date: Tue, 23 Sep 2025 14:20:45 +0300 [thread overview]
Message-ID: <aNKCjcD6Nab1jWEV@stanley.mountain> (raw)
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")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/infiniband/hw/irdma/verbs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c
index 24f9503f410f..f9d9157029ac 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;
--
2.51.0
next reply other threads:[~2025-09-23 11:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-23 11:20 Dan Carpenter [this message]
2025-09-24 13:56 ` [PATCH next] RDMA/irdma: Fix positive vs negative error codes in irdma_post_send() Jason Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aNKCjcD6Nab1jWEV@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=faisal.latif@intel.com \
--cc=jgg@ziepe.ca \
--cc=kernel-janitors@vger.kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=tatyana.e.nikolova@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox