Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2042278imm; Mon, 16 Jul 2018 00:44:33 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcY6YLRAYyn9dxBo561LjBrxUbhRe6EWR3Ry2BneXDuoglTQU8MjBwDsRqBkmNeX1dtsgoM X-Received: by 2002:a63:d916:: with SMTP id r22-v6mr14303224pgg.381.1531727072946; Mon, 16 Jul 2018 00:44:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531727072; cv=none; d=google.com; s=arc-20160816; b=mJFz4HVMMO1mXs/lVDw6+czn3J0lysN0BuOr97s6nHY7CC+aNpZHjBHbklOOd8XGfD IcImgoMaEWPOrkWaWWGqqSowhCrP3VXDXMqtqq4ViCoxMnRRwVr4BFfM2CGA8VGtsHn/ n0xW6ofqOckAQu0QYvJDCS+GHmBkRqsxrHaTUnHLJNaBray4/HTe+61N8RDy72R+SIi3 ggKc1dKLbvzb9PpGj2DKgwnf5bGDgSSAj980ubHzUDCndTrhCaebVyeYxTCOwk2pA4Zc Mm0kC/GVjwPEIMtfYj7rGU3VHa0m04NfOBLCtySOT0c2eewJcICxR9FiyMYFmX2QRA1y Ikyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=MURKmxVZ6doVGSTgiwungx9J426UsdYrVPqdH4fA4rM=; b=OD44psTvCgRhko4T6uoT1TPZ5b+VP80F5BXtdNjNktpxuPArC+wwH50uhzYI1+2eba cym5EVXSf5Vn1UTUQdQnaWRYkmiIjaa3c9UiElsPzHg78XBSrH1GBgMjU4ut5Wtvh5Jf K/R8oEHBdPeR7fl2+gw7o8iFnaZm/bf0q/OXOuclGIymcMaKbpj2pDodx8qt2tkp31MA 7yK2lJgXHYhSQ0nRjM23pvzQyBpknTSWJFwEGq++/qFNHa47owkPjyF2bMkWWTTVjztK f1rOZeS6AsKij3x08ApIx91j1FF8j+hMCfEsdS4WnK/k6PFI67f8DZUAgKr/zjtBf5wY biRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r25-v6si28066377pge.104.2018.07.16.00.44.18; Mon, 16 Jul 2018 00:44:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388939AbeGPIJI (ORCPT + 99 others); Mon, 16 Jul 2018 04:09:08 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47924 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730161AbeGPIJI (ORCPT ); Mon, 16 Jul 2018 04:09:08 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 40087CA0; Mon, 16 Jul 2018 07:43:05 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Steve Wise , Jason Gunthorpe Subject: [PATCH 4.9 24/32] iw_cxgb4: correctly enforce the max reg_mr depth Date: Mon, 16 Jul 2018 09:36:32 +0200 Message-Id: <20180716073507.565316911@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180716073504.433996952@linuxfoundation.org> References: <20180716073504.433996952@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Steve Wise commit 7b72717a20bba8bdd01b14c0460be7d15061cd6b upstream. The code was mistakenly using the length of the page array memory instead of the depth of the page array. This would cause MR creation to fail in some cases. Fixes: 8376b86de7d3 ("iw_cxgb4: Support the new memory registration API") Cc: stable@vger.kernel.org Signed-off-by: Steve Wise Signed-off-by: Jason Gunthorpe Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/hw/cxgb4/mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/infiniband/hw/cxgb4/mem.c +++ b/drivers/infiniband/hw/cxgb4/mem.c @@ -724,7 +724,7 @@ static int c4iw_set_page(struct ib_mr *i { struct c4iw_mr *mhp = to_c4iw_mr(ibmr); - if (unlikely(mhp->mpl_len == mhp->max_mpl_len)) + if (unlikely(mhp->mpl_len == mhp->attr.pbl_size)) return -ENOMEM; mhp->mpl[mhp->mpl_len++] = addr;