* [PATCH next] RDMA/irdma: Fix positive vs negative error codes in irdma_post_send()
@ 2025-09-23 11:20 Dan Carpenter
2025-09-24 13:56 ` Jason Gunthorpe
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2025-09-23 11:20 UTC (permalink / raw)
To: Faisal Latif
Cc: Tatyana Nikolova, Jason Gunthorpe, Leon Romanovsky, linux-rdma,
linux-kernel, kernel-janitors
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH next] RDMA/irdma: Fix positive vs negative error codes in irdma_post_send()
2025-09-23 11:20 [PATCH next] RDMA/irdma: Fix positive vs negative error codes in irdma_post_send() Dan Carpenter
@ 2025-09-24 13:56 ` Jason Gunthorpe
0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2025-09-24 13:56 UTC (permalink / raw)
To: Dan Carpenter
Cc: Faisal Latif, Tatyana Nikolova, Leon Romanovsky, linux-rdma,
linux-kernel, kernel-janitors
On Tue, Sep 23, 2025 at 02:20:45PM +0300, Dan Carpenter wrote:
> 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(-)
Applied to for-next, thanks
Jason
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-09-24 13:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-23 11:20 [PATCH next] RDMA/irdma: Fix positive vs negative error codes in irdma_post_send() Dan Carpenter
2025-09-24 13:56 ` Jason Gunthorpe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox