[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210408113135.92165-1-wangwensheng4@huawei.com>
Date: Thu, 8 Apr 2021 11:31:35 +0000
From: Wang Wensheng <wangwensheng4@...wei.com>
To: <mkalderon@...vell.com>, <aelior@...vell.com>,
<dledford@...hat.com>, <jgg@...pe.ca>,
<linux-rdma@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC: <rui.xiang@...wei.com>
Subject: [PATCH -next] RDMA/qedr: Fix error return code in qedr_iw_connect()
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.
Fixes: 82af6d19d8d9 ("RDMA/qedr: Fix synchronization methods and memory leaks in qedr")
Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Wang Wensheng <wangwensheng4@...wei.com>
---
drivers/infiniband/hw/qedr/qedr_iw_cm.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/qedr/qedr_iw_cm.c b/drivers/infiniband/hw/qedr/qedr_iw_cm.c
index c4bc587..1715fbe 100644
--- a/drivers/infiniband/hw/qedr/qedr_iw_cm.c
+++ b/drivers/infiniband/hw/qedr/qedr_iw_cm.c
@@ -636,8 +636,10 @@ int qedr_iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
memcpy(in_params.local_mac_addr, dev->ndev->dev_addr, ETH_ALEN);
if (test_and_set_bit(QEDR_IWARP_CM_WAIT_FOR_CONNECT,
- &qp->iwarp_cm_flags))
+ &qp->iwarp_cm_flags)) {
+ rc = -ENODEV;
goto err; /* QP already being destroyed */
+ }
rc = dev->ops->iwarp_connect(dev->rdma_ctx, &in_params, &out_params);
if (rc) {
--
2.9.4
Powered by blists - more mailing lists