check pmd type before modifying pte
PATCH 1/1 check pmd type before modifying pte
This patch could give a warning before modifing pte when pmd type is not correct.
Signed-off-by janboe <[email protected]>
--- arch/arm/mm/mmu.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
arch/arm/mm/mmu.c +5 -0
@@ -487,6 +487,11 @@ static void __init alloc_init_pte(pmd_t *pmd, unsigned long addr,__pmd_populate (pmd,__pa (pte) | type->prot_l1); } +if (pmd_bad (*pmd)) +printk (KERN_WARNING "BUG: mapping for 0x%8lx at 0x%08lx " +"pmd is not correct\n" , +__pfn_to_phys (pfn), addr); + pte =pte_offset_kernel (pmd, addr); do { set_pte_ext(pte, pfn_pte(pfn, __pgprot(type->prot_pte)), 0);
Signature · 1 line
1.6.3.3