All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] RDMA/qedr: Fix error return code in qedr_iw_connect()
@ 2021-04-08 11:31 Wang Wensheng
  2021-04-08 14:16 ` Michal Kalderon
  2021-04-12 18:28 ` Jason Gunthorpe
  0 siblings, 2 replies; 3+ messages in thread
From: Wang Wensheng @ 2021-04-08 11:31 UTC (permalink / raw)
  To: mkalderon, aelior, dledford, jgg, linux-rdma, linux-kernel; +Cc: rui.xiang

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@huawei.com>
Signed-off-by: Wang Wensheng <wangwensheng4@huawei.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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-12 18:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-08 11:31 [PATCH -next] RDMA/qedr: Fix error return code in qedr_iw_connect() Wang Wensheng
2021-04-08 14:16 ` Michal Kalderon
2021-04-12 18:28 ` Jason Gunthorpe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.