diff options
author | Jon Medhurst (Tixy) <tixy@linaro.org> | 2012-11-28 11:17:51 +0000 |
---|---|---|
committer | Tushar Behera <tushar.behera@linaro.org> | 2013-04-02 14:43:37 +0530 |
commit | 2265cef13cc7f3a131d68f3d175299dd23eac5c2 (patch) | |
tree | c43d68a9e83ef5ddbf77b2a5409d835cfb6f99d8 | |
parent | bc36742e39cae9c47edab0effd2804ecfaed21bb (diff) |
ARM: mm: Allow an empty PMD in alloc_init_pte()
The Android patch titled "ARM: allow the kernel text section to
be made read-only" modifies alloc_init_pte() and adds a BUG_ON
to detect the case where a section mapping is being overwritten.
However the test doesn't allow for the legitimate case where the
PMD is empty, as can happen for kernels built with CONFIG_ARM_LPAE.
So extend the test to allow this.
Signed-off-by: Jon Medhurst <tixy@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
-rw-r--r-- | arch/arm/mm/mmu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index b4f9e2b04b4f..8078066282e7 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -636,7 +636,7 @@ static void __init alloc_init_pte(pmd_t *pmd, unsigned long addr, pte_t *pte = start_pte + pte_index(addr); /* If replacing a section mapping, the whole section must be replaced */ - BUG_ON(pmd_bad(*pmd) && ((addr | end) & ~PMD_MASK)); + BUG_ON(!pmd_none(*pmd) && pmd_bad(*pmd) && ((addr | end) & ~PMD_MASK)); do { set_pte_ext(pte, pfn_pte(pfn, __pgprot(type->prot_pte)), 0); |