diff mbox series

x86/efi: Free efi_pgd with free_pages()

Message ID 20190528125805.2166-1-mail@lennart-glauer.de (mailing list archive)
State Deferred, archived
Headers show
Series x86/efi: Free efi_pgd with free_pages() | expand

Commit Message

Lennart Glauer May 28, 2019, 12:58 p.m. UTC
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 <mail@lennart-glauer.de>
---
 arch/x86/platform/efi/efi_64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

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;
 	}