Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp349300pxf; Thu, 8 Apr 2021 04:35:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOl3A6myDRyPo/g7AiS9+ECgf5qHBgOoEM+wAhdXUdk1Sjsd4HtXiBcw0LGwVP17d09muk X-Received: by 2002:a65:5184:: with SMTP id h4mr7640463pgq.219.1617881732347; Thu, 08 Apr 2021 04:35:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617881732; cv=none; d=google.com; s=arc-20160816; b=LvHDS9rvQRyZ1Nda047i0qb6B28Jvq39suysLvEyEHssJvq7Ir8v1rYiPm8SOuEH7y vYQpPHgRZe41LGW/YjqvSncanD+2OwwJ/C9m7QaMBf0tugJBJzB9XPprVHDf4Bm4eizp ESxCOwa4TrLXDWcr75x43SDwBf44rkGLAVgtKNmQBevbz2kVMFyHLvlSkPPrLwCKo1Ub 1w2xD5Bj6wy9Whwkt0/CoiTT27FwMCamNdIkIdYF8oDqa83jg//3usFJA1nOCmA38CxS MItW2jlbVOWxx9KOIZqAKk43Oec9Q9AmSlJ3tY/qM3JzO5rAq+U3cVshw0OPSB+uyo1f RAtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=plPDWFtYMaBVKTPhiQKiW8cIsh7xgTBHbA/2alsD1fA=; b=JjG2hvT9Ln3CEfDih5WKBY1/FzWbXZZVPbskwJuvxKR8WtAmfos/dlJdFX43KNj3Iy P3FUsrLgu1nPDxS7ZVbzSKD/cK3qelsvV+3CpgWwmmI6YKslJ5KHawRJ0ntnv8u33OMj KC2UIxOZa16G0JOdHK8hKAt2xMC+Y46iAMgwtVamZCm8cHtGR2zfg9YpLShRViNNZEPe H+8M4JUuSjJrczguTBJeLJuxQ5N7uC6JEXsGvPYlcCA0nbnqpwgF2Tg631BdvBAvK3Kj x3NBh2ViG9iHpwYwfKIq8ltKh/MqIUAHrpeQe9sCgkDJ9vj1lj/Hvoii5RrMNY5UiJOM 9C0w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l1si27769951plt.82.2021.04.08.04.35.19; Thu, 08 Apr 2021 04:35:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231329AbhDHLen (ORCPT + 99 others); Thu, 8 Apr 2021 07:34:43 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:16838 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231255AbhDHLem (ORCPT ); Thu, 8 Apr 2021 07:34:42 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4FGJyV045xz7txY; Thu, 8 Apr 2021 19:32:18 +0800 (CST) Received: from huawei.com (10.175.112.208) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Thu, 8 Apr 2021 19:34:22 +0800 From: Wang Wensheng To: , , , , , CC: Subject: [PATCH -next] RDMA/qedr: Fix error return code in qedr_iw_connect() Date: Thu, 8 Apr 2021 11:31:35 +0000 Message-ID: <20210408113135.92165-1-wangwensheng4@huawei.com> X-Mailer: git-send-email 2.9.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.112.208] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Wang Wensheng --- 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