Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3063565yba; Mon, 6 May 2019 16:34:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqzouoTIAClZVz6/PivGisJVtUVdtwvBA7JL5sljvJY5LJcL3tn69/LzhPMkJpwvkgSTabsy X-Received: by 2002:a17:902:a510:: with SMTP id s16mr11335458plq.334.1557185643219; Mon, 06 May 2019 16:34:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557185643; cv=none; d=google.com; s=arc-20160816; b=pp7X8QWzhWfaN1Ga5jeq86bY2lIB8EfcZCR4OjBPRYvmfMBR90BqKYE299kX0dXCmV hIvvVbmrX97oPw17mkoG1k43yfPfCWxSfmiXRcsBA9GaHZ1xA1XryT8wuubOGPO4Kbx2 mBfHOFtJ88d/hql9Cr8+r6xtbKcqJ0PIdTVvXV0AQFQpU/UbRM9j7lKdC8OKeMqkImc4 myaUFbshFPQJ/eDIeckBsHkzrcI4KC9RRN8R7PkiMergo8bNJOMlpuBLhy/74BTbXWcU IzxFPKAu3bmih2j5sRvIh+q+zLtBx+nKK0Vd9Pny3SeQzUQpZJRcbML/VORPuOPdALSg e6tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=5WlIjBgfvDyvCsXkm0NjNZ11WXFUwiQ4B+j31tyLuKg=; b=fkK9c2N9R+oMhJpu9qLqLLrOwlx4YHmaL+T3iW/W8uiaasp+dZnqiF+s8OpKTxHcPY gAyyGbrPzPjLgPFSkbNSGCAx8Y1WSWnoks70gZSirDP21R3bFg7ZMdhs6bGcrhKg/PI6 jeLxBxFqQH8R3iV3tNGxgAzUQMMYkvuSUYlin/Xxj269PPxCEglSjkgkJKd0qCIIX4p9 o7/6sQ4Evta6O46gZStAhBjTubqR8A8L6mkQsPBryrxZMrNnvSbbamw7uy2wRl3skPDI sN0u3U/Pjz39z/eingUV+auBj+2gTrNjGht0UFLYmXAMCfwffv0GYpOKLswThq8ZOaHS 1F0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=KhdjRbMY; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i2si12865031pgi.0.2019.05.06.16.33.47; Mon, 06 May 2019 16:34:03 -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; dkim=pass header.i=@nvidia.com header.s=n1 header.b=KhdjRbMY; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726503AbfEFXax (ORCPT + 99 others); Mon, 6 May 2019 19:30:53 -0400 Received: from hqemgate15.nvidia.com ([216.228.121.64]:15239 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725994AbfEFXav (ORCPT ); Mon, 6 May 2019 19:30:51 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 06 May 2019 16:30:16 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Mon, 06 May 2019 16:30:50 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Mon, 06 May 2019 16:30:50 -0700 Received: from rcampbell-dev.nvidia.com (172.20.13.39) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 6 May 2019 23:30:50 +0000 From: To: CC: , Ralph Campbell , John Hubbard , Ira Weiny , Dan Williams , Arnd Bergmann , Balbir Singh , Dan Carpenter , Matthew Wilcox , Souptick Joarder , Andrew Morton Subject: [PATCH 3/5] mm/hmm: Use mm_get_hmm() in hmm_range_register() Date: Mon, 6 May 2019 16:29:40 -0700 Message-ID: <20190506232942.12623-4-rcampbell@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190506232942.12623-1-rcampbell@nvidia.com> References: <20190506232942.12623-1-rcampbell@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public X-Originating-IP: [172.20.13.39] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL101.nvidia.com (172.20.187.10) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1557185416; bh=5WlIjBgfvDyvCsXkm0NjNZ11WXFUwiQ4B+j31tyLuKg=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:X-NVConfidentiality: X-Originating-IP:X-ClientProxiedBy:Content-Transfer-Encoding: Content-Type; b=KhdjRbMYg4rMUz7KfK9xJEDf8RwHRFmHw5yW1h4Jhf0lnVFlVigwpaMNLfTtjfrFx FSIoT52YDf6KQSTBJdQfBl0Y1SP60r51yon4cBXYK9TZYAcpO2GqaSkcFKpR3kteJr 9827Jc7XMXh9Mj3Brr3ZtP217RpbYYz1SQ0Nq9ZoiNGBmos3CU60FFaGS+avEFFpb5 cMxwubKqGavAbg5bTZ6Ioa2/Ov1aLGeAmVmwfEtyYXUDolypmiKZUxu+hA+nRIz0U8 jFTgs+iYsHmsF6Cr3/i1vWvMvEF6Q0erFwpi0nglHSYFRtvywldCLt2OpEHi64nDss c7GjIKJjQXBCQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ralph Campbell In hmm_range_register(), the call to hmm_get_or_create() implies that hmm_range_register() could be called before hmm_mirror_register() when in fact, that would violate the HMM API. Use mm_get_hmm() instead of hmm_get_or_create() to get the HMM structure. Signed-off-by: Ralph Campbell Cc: John Hubbard Cc: Ira Weiny Cc: Dan Williams Cc: Arnd Bergmann Cc: Balbir Singh Cc: Dan Carpenter Cc: Matthew Wilcox Cc: Souptick Joarder Cc: Andrew Morton --- mm/hmm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/hmm.c b/mm/hmm.c index f6c4c8633db9..2aa75dbed04a 100644 --- a/mm/hmm.c +++ b/mm/hmm.c @@ -936,7 +936,7 @@ int hmm_range_register(struct hmm_range *range, range->start =3D start; range->end =3D end; =20 - range->hmm =3D hmm_get_or_create(mm); + range->hmm =3D mm_get_hmm(mm); if (!range->hmm) return -EFAULT; =20 --=20 2.20.1