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>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200802111542.5475-1-tianjia.zhang@linux.alibaba.com>
Date:   Sun,  2 Aug 2020 19:15:42 +0800
From:   Tianjia Zhang <tianjia.zhang@...ux.alibaba.com>
To:     dledford@...hat.com, jgg@...pe.ca, leon@...nel.org,
        parav@...lanox.com, maorg@...lanox.com, maxg@...lanox.com,
        monis@...lanox.com, chuck.lever@...cle.com
Cc:     linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org,
        tianjia.zhang@...baba.com
Subject: [PATCH] IB/core: Fix wrong return value in _ib_modify_qp()

On an error exit path, a negative error code should be returned
instead of a positive return value.

Fixes: 7a5c938b9ed09 ("IB/core: Check for rdma_protocol_ib only after validating port_num")
Cc: Jason Gunthorpe <jgg@...pe.ca>
Signed-off-by: Tianjia Zhang <tianjia.zhang@...ux.alibaba.com>
---
 drivers/infiniband/core/verbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index 53d6505c0c7b..f369f0a19e85 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -1712,7 +1712,7 @@ static int _ib_modify_qp(struct ib_qp *qp, struct ib_qp_attr *attr,
 		if (!(rdma_protocol_ib(qp->device,
 				       attr->alt_ah_attr.port_num) &&
 		      rdma_protocol_ib(qp->device, port))) {
-			ret = EINVAL;
+			ret = -EINVAL;
 			goto out;
 		}
 	}
-- 
2.26.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ