From patchwork Fri Mar 4 18:53:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Marciniszyn X-Patchwork-Id: 609891 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p24IqkJo014512 for ; Fri, 4 Mar 2011 18:53:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759978Ab1CDSxS (ORCPT ); Fri, 4 Mar 2011 13:53:18 -0500 Received: from [198.186.4.11] ([198.186.4.11]:37019 "EHLO kop-dev-sles11-04.qlogic.org" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1759900Ab1CDSxS (ORCPT ); Fri, 4 Mar 2011 13:53:18 -0500 Received: from kop-dev-sles11-04.qlogic.org (localhost [IPv6:::1]) by kop-dev-sles11-04.qlogic.org (Postfix) with ESMTP id 6D40D27E2BD; Fri, 4 Mar 2011 13:53:17 -0500 (EST) Subject: [PATCH v2] IB/qib: Fix M_Key field in SubnGet and SubnGetResp MADs To: Roland Dreier From: Mike Marciniszyn Cc: linux-rdma@vger.kernel.org, tom.elken@qlogic.com Date: Fri, 04 Mar 2011 13:53:17 -0500 Message-ID: <20110304185317.3967.81450.stgit@kop-dev-sles11-04.qlogic.org> User-Agent: StGit/0.15 MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 04 Mar 2011 18:53:19 +0000 (UTC) diff --git a/drivers/infiniband/hw/qib/qib_mad.c b/drivers/infiniband/hw/qib/qib_mad.c index 7c44726..13a0c12 100644 --- a/drivers/infiniband/hw/qib/qib_mad.c +++ b/drivers/infiniband/hw/qib/qib_mad.c @@ -464,8 +464,9 @@ static int subn_get_portinfo(struct ib_smp *smp, struct ib_device *ibdev, memset(smp->data, 0, sizeof(smp->data)); /* Only return the mkey if the protection field allows it. */ - if (smp->method == IB_MGMT_METHOD_SET || ibp->mkey == smp->mkey || - ibp->mkeyprot == 0) + if (!(smp->method == IB_MGMT_METHOD_GET && + ibp->mkey != smp->mkey && + ibp->mkeyprot == 1)) pip->mkey = ibp->mkey; pip->gid_prefix = ibp->gid_prefix; lid = ppd->lid;