Received: by 10.213.65.68 with SMTP id h4csp238376imn; Fri, 23 Mar 2018 03:38:20 -0700 (PDT) X-Google-Smtp-Source: AG47ELszq853+GNPzU7kOqBjpoTKjCfE2IiGyG/eqfQSbmKiB8IOJBeT7vDdKhNK6LlGV27o1W2D X-Received: by 10.99.65.6 with SMTP id o6mr11914408pga.57.1521801500494; Fri, 23 Mar 2018 03:38:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521801500; cv=none; d=google.com; s=arc-20160816; b=TjLVsP6/Nv+AN4X2pGulyhd9qkAwTdtitRmguO7cUIttvkwJXKElIQkkgX631HF2An KbDHy/UY7eKgmDElme85Zn/7WVwfVIoRGGaPsp0bUf/NUcLidHA8TdOtgdelqi2FVo6R 7+YPoPfBX8mgQAd5f4XVp38kI93Kk3CZNBfZ3ehPJSW2jMRuCC3kPMAxYcf8RWPwfTO3 1pmg+5Qc2kCiSMJ/tmpPnqX3AY48tUhnCXnMSwG4oyE++DXzSYSB6Z1nY7JMTQf606Nm 8ekpXudhDgCJqPR2yDCnE7YmokPr/qY0aoBQPWiKLlQHFr+tdK7fO5q0ZguCGKmW+Lx0 ch5A== 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=zcVtOewfMzfpi3M6yZozydzrFl4D8SzeRBux2x306UQ=; b=N3F3koc20n/ULW29HfbaTQcI3igjD4UzbgLENiUfhsx6y6TeAvYh1MaatgZ72KBxf+ wm8nkGWpBcXKs2fn/KfXIyMqaQMk/DyMy/EBlv2UHx9CalDScFYsh+whz3w+0h2pOREF 4b4B0LZH5TAsAk6C8pZ2sDJpE2DcKR9L8Jxqj3Alm0EuFqEcB7r6Rikbv7ICNu3/S8KA erhPUgIoKcmr/jNRvf/K1SmNI7zI+/X85YAB50mjqZ04EEOoe1kR56vGAgpYGXTXnvBs T/XC7ccjGHiqyAEubhgzlIKX0Q6YNI7E9XEZLYJQYjHZdbg0VILEtE+rmePifz6+gLyf ca0g== 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 k4-v6si1719548pll.176.2018.03.23.03.38.06; Fri, 23 Mar 2018 03:38:20 -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 S1754471AbeCWKR2 (ORCPT + 99 others); Fri, 23 Mar 2018 06:17:28 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47188 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933522AbeCWKRZ (ORCPT ); Fri, 23 Mar 2018 06:17:25 -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 3F85DE4F; Fri, 23 Mar 2018 10:17:25 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Artemy Kovalyov , Leon Romanovsky , Jason Gunthorpe , Sasha Levin Subject: [PATCH 4.4 85/97] IB/umem: Fix use of npages/nmap fields Date: Fri, 23 Mar 2018 10:55:12 +0100 Message-Id: <20180323094202.264089737@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180323094157.535925724@linuxfoundation.org> References: <20180323094157.535925724@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: Artemy Kovalyov [ Upstream commit edf1a84fe37c51290e2c88154ecaf48dadff3d27 ] In ib_umem structure npages holds original number of sg entries, while nmap is number of DMA blocks returned by dma_map_sg. Fixes: c5d76f130b28 ('IB/core: Add umem function to read data from user-space') Signed-off-by: Artemy Kovalyov Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/core/umem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/infiniband/core/umem.c +++ b/drivers/infiniband/core/umem.c @@ -354,7 +354,7 @@ int ib_umem_copy_from(void *dst, struct return -EINVAL; } - ret = sg_pcopy_to_buffer(umem->sg_head.sgl, umem->nmap, dst, length, + ret = sg_pcopy_to_buffer(umem->sg_head.sgl, umem->npages, dst, length, offset + ib_umem_offset(umem)); if (ret < 0)