Skip to content

Commit 4ff8a14

Browse files
committed
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 fix from Will Deacon: "Just one small fix here, preventing a VM_WARN_ON when a !present PMD/PUD is "freed" as part of a huge ioremap() operation. The correct behaviour is to skip the free silently in this case, which is a little weird (the function is a bit of a misnomer), but it follows the x86 implementation" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: fix erroneous warnings in page freeing functions
2 parents 5393734 + fac880c commit 4ff8a14

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

arch/arm64/mm/mmu.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -985,8 +985,9 @@ int pmd_free_pte_page(pmd_t *pmdp, unsigned long addr)
985985

986986
pmd = READ_ONCE(*pmdp);
987987

988-
/* No-op for empty entry and WARN_ON for valid entry */
989-
if (!pmd_present(pmd) || !pmd_table(pmd)) {
988+
if (!pmd_present(pmd))
989+
return 1;
990+
if (!pmd_table(pmd)) {
990991
VM_WARN_ON(!pmd_table(pmd));
991992
return 1;
992993
}
@@ -1007,8 +1008,9 @@ int pud_free_pmd_page(pud_t *pudp, unsigned long addr)
10071008

10081009
pud = READ_ONCE(*pudp);
10091010

1010-
/* No-op for empty entry and WARN_ON for valid entry */
1011-
if (!pud_present(pud) || !pud_table(pud)) {
1011+
if (!pud_present(pud))
1012+
return 1;
1013+
if (!pud_table(pud)) {
10121014
VM_WARN_ON(!pud_table(pud));
10131015
return 1;
10141016
}

0 commit comments

Comments
 (0)