Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2046154imm; Mon, 16 Jul 2018 00:50:35 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfZ4KIFGLVXo78DlQkFEc8AYdEzFKFrXzUcQ8tEHSGAoGQPuD6pVE5k3ix06gnD37SJW9N/ X-Received: by 2002:a17:902:9a01:: with SMTP id v1-v6mr15993712plp.20.1531727435753; Mon, 16 Jul 2018 00:50:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531727435; cv=none; d=google.com; s=arc-20160816; b=Mle2q4F9poecTKJohUeosDnoiRs7NDproJ94c37QhV5k4r/rIlpd6Jlqe/kb/I9t5m MlMPb5taWs9zKOP2AM3Y/PECx28iifd8SpBMZSulfkiW7aGndYo0yuWPs89uHRwzUkxc Z+zrnj3c+Kla3q1wVgHMyGShyi8tZfugm7CmcCDyIU+BUYjqftLEwfW7H+CHBJ4z6uq2 RVw75fheGzIPi33Z3MbXT4hurrbyNgCl02dIGYAjDInL8WxFdspiIMiP5OHvaPFY8JWj kTm+WeevpsHjXvV09P3RyCfFS3KcEwYaDumwE014Q/7S5mdbKiz2XEb7rzcNXTHSDtBs 1KYg== 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=uMKjt3GOQRBNO5v33Cypb2DdtKnoOPAJmSRCaQwE6Lk=; b=QVxq8XVbBMAVKj5RUZT+fyQo8E7A8hZqne3+61sPoLNEuIo204hZp6QqL1TtiEfzi0 eSbzdzLqiMcnxRqtgYOhfi2bN5J77GKzJteE25JIMqByCf85zwIkRqNEVd65E4vI0CM+ 4WOWYQ4faClsEtSjKsQ0uZM6hz8pcwLraxFxI96NNQxBzA/c/EBwl26xjHQeFfUgrdQo TJGd44LktOppzhD4wNQ8Y1MRxu4We/kFOWdM4OUCP4muerkbRgjFdH+jIjqiEgok5HdQ x8FTlwD82niXxUn89lP6V2SLH5Gq59jMHjljqonxBHAlkumTwHcj0FNZ8JeXmx7MOA29 wbEg== 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 a1-v6si10703246pga.639.2018.07.16.00.50.21; Mon, 16 Jul 2018 00:50:35 -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 S2389591AbeGPIO0 (ORCPT + 99 others); Mon, 16 Jul 2018 04:14:26 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48144 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388375AbeGPIKQ (ORCPT ); Mon, 16 Jul 2018 04:10:16 -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 07ED4CA0; Mon, 16 Jul 2018 07:44:12 +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.4 15/43] iw_cxgb4: correctly enforce the max reg_mr depth Date: Mon, 16 Jul 2018 09:36:20 +0200 Message-Id: <20180716073513.467557049@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180716073511.796555857@linuxfoundation.org> References: <20180716073511.796555857@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.4-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 @@ -926,7 +926,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;