summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSven Schnelle <svens@stackframe.org>2019-06-05 22:32:19 +0200
committerHelge Deller <deller@gmx.de>2019-06-08 12:56:26 +0200
commite4eab1ce1f679507c02ea48e6b6edaef33f8fee3 (patch)
treeaaf9850420e14e35ad3daa0e41f7ce9865cb6788 /arch
parentparisc: add spinlock to patch function (diff)
downloadlinux-e4eab1ce1f679507c02ea48e6b6edaef33f8fee3.tar.xz
linux-e4eab1ce1f679507c02ea48e6b6edaef33f8fee3.zip
parisc: add WARN_ON() to clear_fixmap
Calling clear_fixmap() on an already cleared fixed mapping is a bad thing to do. Add a WARN_ON() to catch such issues. Signed-off-by: Sven Schnelle <svens@stackframe.org> Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/parisc/mm/fixmap.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/parisc/mm/fixmap.c b/arch/parisc/mm/fixmap.c
index c8d41b54fb19..36321bcd75ba 100644
--- a/arch/parisc/mm/fixmap.c
+++ b/arch/parisc/mm/fixmap.c
@@ -35,6 +35,9 @@ void clear_fixmap(enum fixed_addresses idx)
pmd_t *pmd = pmd_offset(pgd, vaddr);
pte_t *pte = pte_offset_kernel(pmd, vaddr);
+ if (WARN_ON(pte_none(*pte)))
+ return;
+
pte_clear(&init_mm, vaddr, pte);
flush_tlb_kernel_range(vaddr, vaddr + PAGE_SIZE);