Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp197865pxb; Thu, 12 Nov 2020 01:06:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJzR3dS2ZfbmczAPixOBZJnZ0fZN/NVF45BBpT/enO1tDL36ugaQ/RPENyuqKSoycZAvUvDW X-Received: by 2002:aa7:ccd2:: with SMTP id y18mr4105566edt.11.1605171980546; Thu, 12 Nov 2020 01:06:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605171980; cv=none; d=google.com; s=arc-20160816; b=KCeHZO8/dg3sYb1sM6HdIrZdPAKI22LUIMrXLNxsfSPxgyzi+gLRJBvD6qi0qpWPVV kvA0zxnI40RTyDvbOInKc3sbWbCUtx4tKV8aYHQDzYkpkeS/h5Cs0sp+YrSh4uEmOgJO +VDmJrwIdgTi4hsxWUrWdQFswE7uyoixX56dhkKIETMU4HrNCsh1ks9OsdWTWjaMaFWz m4v97UdATkeO8Bn02XmJeytlUdBWaI3SVfSRi7kYr52AvTCLEr4i8NFB1Ma7mlEPOY4g +VYUobEZyAVPsMRc9Ob804QOjCJy0Q3th+is9AnGqrtsXxKqqX59BULMRvXO6T8/q8oE TTZw== 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 :message-id:date:subject:cc:to:from; bh=nH1gR7paIDa0jDbGiKZc5V4DrLm0R/I4hYyUKPjMERw=; b=Ihb1pJYYu1KFeDSh4looWneuCSjzxX58Z92fqDTcla+T1jVontZdzba+gSHLuESZgy KaZ2UGpucSjiNf/7Is6D4gBE3CpQOIA1HUGXZq/NuHUn7LxzrZIQbsk+VZNpUemMI3fl ALPFX7pnddVE/CRi9bGQd7aKEXBkTLEgZuB/6HKZ1KxhDUT/Kt3Pg8xVktUIRnvCAAJa 7UowkQi0f3jmag/qgRNDy9taa2uI89MX5V50g3vYfQEc3NVXomBl75qoFhDrsABHF+ae UdqPya2CGsWaEjIaoY4DaNXcLIJCMTUYrSJGs/3y0jmhMipZMKGVTcSB8BKMx0zn28J+ OHPg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r12si3917300edb.155.2020.11.12.01.05.55; Thu, 12 Nov 2020 01:06:20 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726671AbgKLJBi (ORCPT + 99 others); Thu, 12 Nov 2020 04:01:38 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:7176 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725966AbgKLJBi (ORCPT ); Thu, 12 Nov 2020 04:01:38 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4CWwZF2fBJz15VWx; Thu, 12 Nov 2020 17:01:25 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Thu, 12 Nov 2020 17:01:24 +0800 From: Chen Zhou To: , , , CC: , , , Hulk Robot Subject: [PATCH] RDMA/core: Fix error return code in _ib_modify_qp() Date: Thu, 12 Nov 2020 17:06:26 +0800 Message-ID: <20201112090626.184976-1-chenzhou10@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] 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 in function _ib_modify_qp(), as done elsewhere in this function. Fixes: 51aab12631dd ("RDMA/core: Get xmit slave for LAG") Reported-by: Hulk Robot Signed-off-by: Chen Zhou --- drivers/infiniband/core/verbs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c index 740f8454b6b4..3d895cc41c3a 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c @@ -1698,8 +1698,10 @@ static int _ib_modify_qp(struct ib_qp *qp, struct ib_qp_attr *attr, slave = rdma_lag_get_ah_roce_slave(qp->device, &attr->ah_attr, GFP_KERNEL); - if (IS_ERR(slave)) + if (IS_ERR(slave)) { + ret = PTR_ERR(slave); goto out_av; + } attr->xmit_slave = slave; } } -- 2.20.1