Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9089818pxu; Mon, 28 Dec 2020 06:23:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJzIWxN6+r4ZcSa4f34MS41twHFgAo0ax85J5WI/2WjkfL1sxBVQ4Ix2EJCi3yWr79h8KhQM X-Received: by 2002:aa7:cc15:: with SMTP id q21mr42629672edt.213.1609165391251; Mon, 28 Dec 2020 06:23:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609165391; cv=none; d=google.com; s=arc-20160816; b=AaG+aHWRXkrsPO6pba0Ip57znlth7yHPSnbUF/Y3LO82q5QBEx6sD6wuQ7932svWcL oIc3QQE82HN5gFZtgnLCA4i2bNUKvmWKxx4CBuGOwITKxk9NMWAkaDWscL9KIOLMX+z0 ySQvudT4ZFgHjEQiKqwnLPbmN6bcgXYulSS3FEfs6Nprw5cV6HL58NmRf+1lHkoEHTdH opTYr3Zru9KRHNpu9Ajp/dJTNRLqecdGs54rVlgTreBU0au55n93+fGi3VeJI6DpA1AY PI9ih1Voxa+KTQrGeCYCGn6b/0JmKXdIbRrp4gs8jmqwJp5iwTQIdyKb8b6YQ8KVVOpz A6nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mwxvxlNv2LK0chIczCNKUTOXiItsYUm1pjbT5xc7mYw=; b=m7/u4jO3hv2xzRnQ9vxB+T2fJERcB9Ts7VdnNfGbSAAttvExTEHQvkNxBUIYvBei1Y OwnOByMO8sYTOirrMn/0zJUe3O9h7mOa5GeOF2iUVRSupTO154fbiKkYtTSd9W06tQo9 ijnfgqX82NL/9/D4Gnf3/yKBP9PoExXxA10ASvnKMqIoMVbieWvloXzUBBjC7r5QN4qK PCvvKp4JW3SE4Cv4oM761zvMpbG610b23nDHeg2sr0SBVhA+ENQ3AFkoOhuKO8zhbfkS u5SKGNvtEmv8EISQcTafFwPeNkSQnR10xGty1Z6FVE2Z0Cfm2TL/nrQDcrbupetu5EkH LlDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HXXZnVWG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y17si21355332edm.386.2020.12.28.06.22.47; Mon, 28 Dec 2020 06:23:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HXXZnVWG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437881AbgL1OU6 (ORCPT + 99 others); Mon, 28 Dec 2020 09:20:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:56246 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437851AbgL1OUv (ORCPT ); Mon, 28 Dec 2020 09:20:51 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id C7E51208B6; Mon, 28 Dec 2020 14:20:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609165211; bh=URGn/nc5X3IZVP5lSJ1b5sZFo5R1EmYRzC5wcS5JbQQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HXXZnVWGtCvc5q/GkUBlY368AQjobMvbs84J39E8fv+SM8z717BcdpdBRkQYm1XfR G0d7xxsa14XOQcztZcjaY3pRURGmcHpFUJ56W9py0kCKDuIdxzQ48bKIlsnJNWRZbx BjkRrcAy/cuduemnEzbrvZvA1bmVgDetmP+Uz18I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Matthew Wilcox (Oracle)" , David Hildenbrand , Mike Rapoport , Vlastimil Babka , David Miller , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [PATCH 5.10 452/717] sparc: fix handling of page table constructor failure Date: Mon, 28 Dec 2020 13:47:30 +0100 Message-Id: <20201228125042.630608511@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matthew Wilcox (Oracle) [ Upstream commit 06517c9a336f4c20f2064611bf4b1e7881a95fe1 ] The page has just been allocated, so its refcount is 1. free_unref_page() is for use on pages which have a zero refcount. Use __free_page() like the other implementations of pte_alloc_one(). Link: https://lkml.kernel.org/r/20201125034655.27687-1-willy@infradead.org Fixes: 1ae9ae5f7df7 ("sparc: handle pgtable_page_ctor() fail") Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: David Hildenbrand Reviewed-by: Mike Rapoport Acked-by: Vlastimil Babka Cc: David Miller Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- arch/sparc/mm/init_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index 96edf64d4fb30..182bb7bdaa0a1 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c @@ -2894,7 +2894,7 @@ pgtable_t pte_alloc_one(struct mm_struct *mm) if (!page) return NULL; if (!pgtable_pte_page_ctor(page)) { - free_unref_page(page); + __free_page(page); return NULL; } return (pte_t *) page_address(page); -- 2.27.0