From patchwork Mon Aug 17 15:14:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 265991 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C82DC433E4 for ; Mon, 17 Aug 2020 19:29:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 096EB20658 for ; Mon, 17 Aug 2020 19:29:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597692562; bh=0qMyAw59C0MWjKRZoXdZUm+02FzsbsnESMZtyqFa69k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=uLXyKwHtcTmBSYNps6DoQc1aemo87E/eiJVLU2WH8ejs1CcuXR/imZImgMwgABoxo BG/qGxKHRLczX9WTZkHhWxwXioxqjXZamZk6X6XrtOIdT8kcNWzlXUxGoIzrvMTjTm go97m3NjlppAIKiOwpKW6vhlRgSRKy6phuxJec/E= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732064AbgHQT3N (ORCPT ); Mon, 17 Aug 2020 15:29:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:59462 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729978AbgHQPcW (ORCPT ); Mon, 17 Aug 2020 11:32:22 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 62C7B20709; Mon, 17 Aug 2020 15:32:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597678341; bh=0qMyAw59C0MWjKRZoXdZUm+02FzsbsnESMZtyqFa69k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b08kuQSuQAqlE8MfuhMG3e0Y2pCfEI5Lryr8fg3iyhs3iYBwYVQmLGiuJvYX+Vpp9 NzeaQNjfvSZ3h5EBZnAoECiinchOctDbRml04eNAzr/5uhBNa4xTuP2HZ7TR81JDmz enz54dx/kzS9f0R/MJ0x5F/HN8UWP17qWPW86eyw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Li Heng , Parav Pandit , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.8 301/464] RDMA/core: Fix return error value in _ib_modify_qp() to negative Date: Mon, 17 Aug 2020 17:14:14 +0200 Message-Id: <20200817143848.227319625@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143833.737102804@linuxfoundation.org> References: <20200817143833.737102804@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Li Heng [ Upstream commit 47fda651d5af2506deac57d54887cf55ce26e244 ] The error codes in _ib_modify_qp() are supposed to be negative errno. Fixes: 7a5c938b9ed0 ("IB/core: Check for rdma_protocol_ib only after validating port_num") Link: https://lore.kernel.org/r/1595645787-20375-1-git-send-email-liheng40@huawei.com Reported-by: Hulk Robot Signed-off-by: Li Heng Reviewed-by: Parav Pandit Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/core/verbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c index 53d6505c0c7b6..f369f0a19e851 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c @@ -1712,7 +1712,7 @@ static int _ib_modify_qp(struct ib_qp *qp, struct ib_qp_attr *attr, if (!(rdma_protocol_ib(qp->device, attr->alt_ah_attr.port_num) && rdma_protocol_ib(qp->device, port))) { - ret = EINVAL; + ret = -EINVAL; goto out; } }