Message ID | 20200310124531.045083681@linuxfoundation.org |
---|---|
State | Superseded |
Headers | show
Return-Path: <SRS0=QSPG=43=vger.kernel.org=stable-owner@kernel.org> 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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 615CBC10F27 for <stable@archiver.kernel.org>; Tue, 10 Mar 2020 13:12:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 34DC524649 for <stable@archiver.kernel.org>; Tue, 10 Mar 2020 13:12:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583845927; bh=ptD3QUqwy+1I3iUQIgW6CsAeVdev4z3wDgE8zw9ptW0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=FLjcaXNYBJbK5JHxoMDFUYly+1b4C/yvaCK9it+mFwnL34cj/vvvOsYRkY87GM9cD /bgWrMouifldYu19Sos7cWHwiHDbD3bOyWMECcvduDs7tBt0tc8zaKDDAGxV35TBR2 ZcN4hXQ/vk+D3yklT2GNACOCpBbTSx77tXurJK9U= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731515AbgCJNMF (ORCPT <rfc822;stable@archiver.kernel.org>); Tue, 10 Mar 2020 09:12:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:34060 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731512AbgCJNME (ORCPT <rfc822;stable@vger.kernel.org>); Tue, 10 Mar 2020 09:12:04 -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 7651720409; Tue, 10 Mar 2020 13:12:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583845923; bh=ptD3QUqwy+1I3iUQIgW6CsAeVdev4z3wDgE8zw9ptW0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t/yjl1e5AKGw9VacWQnpxiHF0lkpzYXYlAfeLN3IYZdDQllrPP2YleDK1sWGD8ENZ bQBBStHU4Lbma/FlVewYCgIjUlRDA2tt9ViSOHWus7LS6/P7WqXg1qPAQ24KXKslo0 11R6a+h7ABJ6AYBhhEgKz8ZPp4zcMx5kzZLSsguo= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, Maor Gottlieb <maorg@mellanox.com>, Leon Romanovsky <leonro@mellanox.com>, Mike Marciniszyn <mike.marciniszyn@intel.com>, Jason Gunthorpe <jgg@mellanox.com>, Sasha Levin <sashal@kernel.org> Subject: [PATCH 4.19 04/86] RDMA/core: Fix pkey and port assignment in get_new_pps Date: Tue, 10 Mar 2020 13:44:28 +0100 Message-Id: <20200310124531.045083681@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200310124530.808338541@linuxfoundation.org> References: <20200310124530.808338541@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
None
|
expand
|
diff --git a/drivers/infiniband/core/security.c b/drivers/infiniband/core/security.c index 4e2565cccb8ae..839ee047f36be 100644 --- a/drivers/infiniband/core/security.c +++ b/drivers/infiniband/core/security.c @@ -337,11 +337,15 @@ static struct ib_ports_pkeys *get_new_pps(const struct ib_qp *qp, return NULL; if (qp_attr_mask & IB_QP_PORT) - new_pps->main.port_num = - (qp_pps) ? qp_pps->main.port_num : qp_attr->port_num; + new_pps->main.port_num = qp_attr->port_num; + else if (qp_pps) + new_pps->main.port_num = qp_pps->main.port_num; + if (qp_attr_mask & IB_QP_PKEY_INDEX) - new_pps->main.pkey_index = (qp_pps) ? qp_pps->main.pkey_index : - qp_attr->pkey_index; + new_pps->main.pkey_index = qp_attr->pkey_index; + else if (qp_pps) + new_pps->main.pkey_index = qp_pps->main.pkey_index; + if ((qp_attr_mask & IB_QP_PKEY_INDEX) && (qp_attr_mask & IB_QP_PORT)) new_pps->main.state = IB_PORT_PKEY_VALID;