Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp834071ybl; Wed, 11 Dec 2019 08:11:55 -0800 (PST) X-Google-Smtp-Source: APXvYqyCBBTmXRUyPnwBhBz8SoVowiuvM1hSfdaO6zUdt18wb6qHz04KV3ff1vo4afT/+rJ0j6L2 X-Received: by 2002:aca:4f50:: with SMTP id d77mr3386559oib.147.1576080715161; Wed, 11 Dec 2019 08:11:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576080715; cv=none; d=google.com; s=arc-20160816; b=a/ktDOJKbEIfY3/mH9vGNVV3aX6eNpAfrLUmkiOAi3XMwCJx+EMeWgqFk1+zMeYtWS juehQp2h7ZRNsUQv6L6CRYesEvfUi9tZSrdA+0hPNyHwnYe3yqUCGZHdxMiVVq9QOt6c Wd8TfP04rZgauxioEH8fDgMeENhPfAta3vKRHaWP4QNj1Gu7qyr0w2uCeWByV8gr23UY 0fUgIunvuvn7X1+VJihUWM0ocoN9/05ZE4+Qy++LvW6f2aQpHUTrondgTJZr2oQjl0Bl pwFWYHHVg7pR2pC2lfNvaRMxtiJ1Ds2IuCItmD4vRppymFGK8kjY43xFDQ/DIg36DGQh HG3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=x2gexI1mS3ZGtmWrHdRG6Q4IE3QB8/Biv/qWBDVMD3E=; b=jVCwInDlBgBeYmVjulzTyo60Pl+0p+08NPGpN4JXyEWEuNw1fBi7nN8a4/Ag2zkOFJ 6kjzJ0Xnfwalyvz5RFP/oGTplpKWzSVi6LXvY0igyfbetjb5TsT1EG4WOOZVvW+pqla8 JBGtS5qit2inVMh0v1Z/es6dr3LXXyR68OZxs8ek+/FMebW+FjH2gOtrt/AzGTBzNDeO rSfRMbVD/zN7j94aYed6O2NqCFpdHao1h6A0U0F/R5GiSAWId7ETwZOr9ECJTlw5eprv sKPfBdAtNkH+jFvNYR+nbcus0fkrrr3P3hSAbGEbBlfFscyGK0xNL4qgelLY4pX5SCkf rp2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WzG8BK5+; 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 e6si1219767otq.217.2019.12.11.08.11.43; Wed, 11 Dec 2019 08:11:55 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=WzG8BK5+; 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 S1731664AbfLKQLC (ORCPT + 99 others); Wed, 11 Dec 2019 11:11:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:60370 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730598AbfLKPLl (ORCPT ); Wed, 11 Dec 2019 10:11:41 -0500 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 1CDAD24658; Wed, 11 Dec 2019 15:11:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077100; bh=wbC5A6leomBKVGZf/uRvC1lsTAzOW5rIUhYBm2z4gqw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WzG8BK5+Q7mFuF8efZJSibDlmdiX/5rYPexWIi9btv8CL4wKfqF49tHNkY53sZwVA ykiGZByoFQUB2BreU/63LD3S0Ew0JsiwWgVVtPY8feyGAx8zg8LAMyFy7FIVFSwcKU SQ0URQoW7ohWDxbzKSVuVwV3qy942uBU1u5Qpo2A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sirong Wang , Weihang Li , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.3 017/105] RDMA/hns: Correct the value of HNS_ROCE_HEM_CHUNK_LEN Date: Wed, 11 Dec 2019 16:05:06 +0100 Message-Id: <20191211150224.955573972@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150221.153659747@linuxfoundation.org> References: <20191211150221.153659747@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sirong Wang [ Upstream commit 531eb45b3da4267fc2a64233ba256c8ffb02edd2 ] Size of pointer to buf field of struct hns_roce_hem_chunk should be considered when calculating HNS_ROCE_HEM_CHUNK_LEN, or sg table size will be larger than expected when allocating hem. Fixes: 9a4435375cd1 ("IB/hns: Add driver files for hns RoCE driver") Link: https://lore.kernel.org/r/1572575610-52530-2-git-send-email-liweihang@hisilicon.com Signed-off-by: Sirong Wang Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/hns/hns_roce_hem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/hns/hns_roce_hem.h b/drivers/infiniband/hw/hns/hns_roce_hem.h index f1ccb8f35fe59..e41ebc25b1f90 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hem.h +++ b/drivers/infiniband/hw/hns/hns_roce_hem.h @@ -59,7 +59,7 @@ enum { #define HNS_ROCE_HEM_CHUNK_LEN \ ((256 - sizeof(struct list_head) - 2 * sizeof(int)) / \ - (sizeof(struct scatterlist))) + (sizeof(struct scatterlist) + sizeof(void *))) #define check_whether_bt_num_3(type, hop_num) \ (type < HEM_TYPE_MTT && hop_num == 2) -- 2.20.1