Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4624161pxj; Wed, 12 May 2021 09:28:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGrlTiuziUCU0C/0Ea+z8K9e+yzB9D7JnNs0KQD5asOoQRCR8MYlx8+SBkajEOT/8ZKA76 X-Received: by 2002:a17:906:6b96:: with SMTP id l22mr38188503ejr.364.1620836923115; Wed, 12 May 2021 09:28:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620836923; cv=none; d=google.com; s=arc-20160816; b=mm56yIgxGpIyGj/cEyQFxB3dHRs4IFFe1kzXGDDDGGXUOIJTP3+Uml/YW8+v+yWdqg zJs9eqRDqTFkDQsqLsZfsiCFTW3Mdlmbvq44kxJOBE821SnMt5oB+dwKKorp32wsvpUW CoezY5ipZLyQgYL+EBceRIHiz179ujkrSsIl1i2fCphsK3yk+5nISAwwU1Pd8fhb5GtM EywSAQMaCuboEAcabAtnkHynW2rXO3vY8BpUVR8c3opeZL5qK4WSTwhtpWzAsRB1V7JH paOtnUC7ZPvtt6peBd9YfHOlSACw6dlWGYXcgdPK5IoEwgB2w0gdd6LGwQFGGo4ruZcm 9Bmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qyqdFrZK8jcv56Zbqx5zbsb4oMEBYMz8mauSR81oAgo=; b=Q8P1wjYTT5LmX/xZUeMNnXJosrDZ0JFSeax9Mtj+8PAKFkPIuM8hT1NQOKCb7xadOC DgdN87Uig9tooh4hTmiiyYxry1uOLGb9LTrnzwucfCx6HH5MMT2a3Q0raVk+IGGsNgaf eGh9K72NDeeQo8t5ESFOg6+XeWZesPwxV9P136LEfIBFybrlyQASqTcbPzF0nwDtlWcd IJ1YLtEOt1nfuEeD1jNikKXVLfMfNx+BokMid1Dif92MmaCekI8yEPIM0DaBQ4vm34we ZIPauguVtb1Dx6cUrFBekedw1w6m3Wfi2OOYolYiEfvhJb7/Gfs2Ppc3sZvCefD7akFO KWxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=J1B1puvB; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id um1si195302ejb.327.2021.05.12.09.28.19; Wed, 12 May 2021 09:28:43 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=J1B1puvB; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241273AbhELQ06 (ORCPT + 99 others); Wed, 12 May 2021 12:26:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:55290 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236408AbhELPhw (ORCPT ); Wed, 12 May 2021 11:37:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6290F61991; Wed, 12 May 2021 15:19:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832780; bh=quYTqScXBKdkK2nY62PQh4Yv5vVqF+oswUkrvv22/r4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J1B1puvBaxzh5mFuvYENuix0HEryjB19sMIs2XPVs3bWvwbNrm+7/XO7EEAZM2gdI ThSoYSIvpXc1mWD3MuBfegCI/z9JdNvJWDxlaWxxwklN2Q9X/u687+PAncJJqiwFWX nL/FV9/2uPwaQ4I5kfBKb9vhNL6vxX9Ya+rVxTFQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Wang Wensheng , =?UTF-8?q?Michal=20Kalderon=C2=A0?= , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.10 421/530] RDMA/qedr: Fix error return code in qedr_iw_connect() Date: Wed, 12 May 2021 16:48:51 +0200 Message-Id: <20210512144833.606749748@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wang Wensheng [ Upstream commit 10dd83dbcd157baf7a78a09ddb2f84c627bc7f1d ] 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") Link: https://lore.kernel.org/r/20210408113135.92165-1-wangwensheng4@huawei.com Reported-by: Hulk Robot Signed-off-by: Wang Wensheng Acked-by: Michal KalderonĀ  Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- 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 c4bc58736e48..1715fbe0719d 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.30.2