diff mbox series

[RFC,01/18] x86/mm/encrypt: add the missing pte_unmap() call

Message ID 20220429133552.33768-2-zhengqi.arch@bytedance.com (mailing list archive)
State New
Headers show
Series Try to free user PTE page table pages | expand

Commit Message

Qi Zheng April 29, 2022, 1:35 p.m. UTC
The paired pte_unmap() call is missing before the sme_populate_pgd()
returns. Although this code only runs under the CONFIG_X86_64, for
the correctness of the code semantics, it is necessary to add a
paired pte_unmap() call.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 arch/x86/mm/mem_encrypt_identity.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/arch/x86/mm/mem_encrypt_identity.c b/arch/x86/mm/mem_encrypt_identity.c
index b43bc24d2bb6..6d323230320a 100644
--- a/arch/x86/mm/mem_encrypt_identity.c
+++ b/arch/x86/mm/mem_encrypt_identity.c
@@ -190,6 +190,7 @@  static void __init sme_populate_pgd(struct sme_populate_pgd_data *ppd)
 	pte = pte_offset_map(pmd, ppd->vaddr);
 	if (pte_none(*pte))
 		set_pte(pte, __pte(ppd->paddr | ppd->pte_flags));
+	pte_unmap(pte);
 }
 
 static void __init __sme_map_range_pmd(struct sme_populate_pgd_data *ppd)