aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm64/mm/mmu.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
index 65f86271f02b..8080c9f489c3 100644
--- a/arch/arm64/mm/mmu.c
+++ b/arch/arm64/mm/mmu.c
@@ -985,8 +985,9 @@ int pmd_free_pte_page(pmd_t *pmdp, unsigned long addr)
985 985
986 pmd = READ_ONCE(*pmdp); 986 pmd = READ_ONCE(*pmdp);
987 987
988 /* No-op for empty entry and WARN_ON for valid entry */ 988 if (!pmd_present(pmd))
989 if (!pmd_present(pmd) || !pmd_table(pmd)) { 989 return 1;
990 if (!pmd_table(pmd)) {
990 VM_WARN_ON(!pmd_table(pmd)); 991 VM_WARN_ON(!pmd_table(pmd));
991 return 1; 992 return 1;
992 } 993 }
@@ -1007,8 +1008,9 @@ int pud_free_pmd_page(pud_t *pudp, unsigned long addr)
1007 1008
1008 pud = READ_ONCE(*pudp); 1009 pud = READ_ONCE(*pudp);
1009 1010
1010 /* No-op for empty entry and WARN_ON for valid entry */ 1011 if (!pud_present(pud))
1011 if (!pud_present(pud) || !pud_table(pud)) { 1012 return 1;
1013 if (!pud_table(pud)) {
1012 VM_WARN_ON(!pud_table(pud)); 1014 VM_WARN_ON(!pud_table(pud));
1013 return 1; 1015 return 1;
1014 } 1016 }