summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-09-07 10:37:23 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2018-09-07 10:37:23 -0700
commit4ff8a142bdb395482dd8744ed5ec2994dc3b81a3 (patch)
tree67ddb4dbb75063d0b1cb74ba499df72d4070c9e6 /arch
parent539373401411bdc9c9bdedb9908196c8dcccfc43 (diff)
parentfac880c7d074fdfca874114b5c47b36aa034e4ee (diff)
downloadlinux-4ff8a142bdb395482dd8744ed5ec2994dc3b81a3.tar.gz
linux-4ff8a142bdb395482dd8744ed5ec2994dc3b81a3.tar.bz2
linux-4ff8a142bdb395482dd8744ed5ec2994dc3b81a3.zip
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
Diffstat (limited to 'arch')
-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)
pmd = READ_ONCE(*pmdp);
- /* No-op for empty entry and WARN_ON for valid entry */
- if (!pmd_present(pmd) || !pmd_table(pmd)) {
+ if (!pmd_present(pmd))
+ return 1;
+ if (!pmd_table(pmd)) {
VM_WARN_ON(!pmd_table(pmd));
return 1;
}
@@ -1007,8 +1008,9 @@ int pud_free_pmd_page(pud_t *pudp, unsigned long addr)
pud = READ_ONCE(*pudp);
- /* No-op for empty entry and WARN_ON for valid entry */
- if (!pud_present(pud) || !pud_table(pud)) {
+ if (!pud_present(pud))
+ return 1;
+ if (!pud_table(pud)) {
VM_WARN_ON(!pud_table(pud));
return 1;
}