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 <[email protected]>
Signed-off-by: Wang Wensheng <[email protected]>
---
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
> From: Wang Wensheng <[email protected]>
> Sent: Thursday, April 8, 2021 2:32 PM
>
> 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 <[email protected]>
> Signed-off-by: Wang Wensheng <[email protected]>
> ---
> 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
Thanks,?
Acked-by: Michal Kalderon?<[email protected]>
On Thu, Apr 08, 2021 at 11:31:35AM +0000, Wang Wensheng wrote:
> 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 <[email protected]>
> Signed-off-by: Wang Wensheng <[email protected]>
> Acked-by: Michal KalderonĀ <[email protected]>
> ---
> drivers/infiniband/hw/qedr/qedr_iw_cm.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
Applied to for-next, thanks
Jason