lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <aNKCjcD6Nab1jWEV@stanley.mountain>
Date: Tue, 23 Sep 2025 14:20:45 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Faisal Latif <faisal.latif@...el.com>
Cc: Tatyana Nikolova <tatyana.e.nikolova@...el.com>,
	Jason Gunthorpe <jgg@...pe.ca>, Leon Romanovsky <leon@...nel.org>,
	linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org,
	kernel-janitors@...r.kernel.org
Subject: [PATCH next] 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")
Signed-off-by: Dan Carpenter <dan.carpenter@...aro.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ