From patchwork Tue May 28 12:58:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lennart Glauer X-Patchwork-Id: 10964917 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8D58C76 for ; Tue, 28 May 2019 13:14:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C6F02843B for ; Tue, 28 May 2019 13:14:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6FEBB28842; Tue, 28 May 2019 13:14:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 65D9628849 for ; Tue, 28 May 2019 13:14:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726973AbfE1NOx (ORCPT ); Tue, 28 May 2019 09:14:53 -0400 Received: from mailgate2.uni-hannover.de ([130.75.2.114]:56978 "EHLO mailgate2.uni-hannover.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726887AbfE1NOx (ORCPT ); Tue, 28 May 2019 09:14:53 -0400 X-Greylist: delayed 983 seconds by postgrey-1.27 at vger.kernel.org; Tue, 28 May 2019 09:14:51 EDT Received: from kolab.sra.uni-hannover.de (kolab.sra.uni-hannover.de [130.75.33.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mailgate2.uni-hannover.de (Postfix) with ESMTPS id 2DB8D2206; Tue, 28 May 2019 14:58:27 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at sra.uni-hannover.de Received: from lab.sra.uni-hannover.de (aerobus.sra.uni-hannover.de [130.75.33.87]) by kolab.sra.uni-hannover.de (Postfix) with SMTP id DD1F43E0622; Tue, 28 May 2019 14:57:59 +0200 (CEST) Received: (nullmailer pid 2217 invoked by uid 20018); Tue, 28 May 2019 12:58:26 -0000 From: Lennart Glauer To: ard.biesheuvel@linaro.org, dvhart@infradead.org, andy@infradead.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com Cc: x86@kernel.org, linux-efi@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Lennart Glauer Subject: [PATCH] x86/efi: Free efi_pgd with free_pages() Date: Tue, 28 May 2019 14:58:05 +0200 Message-Id: <20190528125805.2166-1-mail@lennart-glauer.de> X-Mailer: git-send-email 2.17.1 Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch fixes another occurrence of free_page() that was missed in 06ace26. The efi_pgd is allocated as PGD_ALLOCATION_ORDER pages and therefore must also be freed as PGD_ALLOCATION_ORDER pages with free_pages(). Signed-off-by: Lennart Glauer --- arch/x86/platform/efi/efi_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c index 08ce8177c3af..acad22a44774 100644 --- a/arch/x86/platform/efi/efi_64.c +++ b/arch/x86/platform/efi/efi_64.c @@ -222,7 +222,7 @@ int __init efi_alloc_page_tables(void) pgd = efi_pgd + pgd_index(EFI_VA_END); p4d = p4d_alloc(&init_mm, pgd, EFI_VA_END); if (!p4d) { - free_page((unsigned long)efi_pgd); + free_pages((unsigned long)efi_pgd, PGD_ALLOCATION_ORDER); return -ENOMEM; }