diff options
-rw-r--r-- | arch/arm64/mm/mmu.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 2eeac10aa0cf..c6daaf6c6f97 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/memblock.h> | 26 | #include <linux/memblock.h> |
27 | #include <linux/fs.h> | 27 | #include <linux/fs.h> |
28 | #include <linux/io.h> | 28 | #include <linux/io.h> |
29 | #include <linux/slab.h> | ||
29 | #include <linux/stop_machine.h> | 30 | #include <linux/stop_machine.h> |
30 | 31 | ||
31 | #include <asm/cputype.h> | 32 | #include <asm/cputype.h> |
@@ -159,8 +160,8 @@ static void alloc_init_pmd(struct mm_struct *mm, pud_t *pud, | |||
159 | flush_tlb_all(); | 160 | flush_tlb_all(); |
160 | if (pmd_table(old_pmd)) { | 161 | if (pmd_table(old_pmd)) { |
161 | phys_addr_t table = __pa(pte_offset_map(&old_pmd, 0)); | 162 | phys_addr_t table = __pa(pte_offset_map(&old_pmd, 0)); |
162 | BUG_ON(alloc != early_alloc); | 163 | if (!WARN_ON_ONCE(slab_is_available())) |
163 | memblock_free(table, PAGE_SIZE); | 164 | memblock_free(table, PAGE_SIZE); |
164 | } | 165 | } |
165 | } | 166 | } |
166 | } else { | 167 | } else { |
@@ -220,8 +221,8 @@ static void alloc_init_pud(struct mm_struct *mm, pgd_t *pgd, | |||
220 | flush_tlb_all(); | 221 | flush_tlb_all(); |
221 | if (pud_table(old_pud)) { | 222 | if (pud_table(old_pud)) { |
222 | phys_addr_t table = __pa(pmd_offset(&old_pud, 0)); | 223 | phys_addr_t table = __pa(pmd_offset(&old_pud, 0)); |
223 | BUG_ON(alloc != early_alloc); | 224 | if (!WARN_ON_ONCE(slab_is_available())) |
224 | memblock_free(table, PAGE_SIZE); | 225 | memblock_free(table, PAGE_SIZE); |
225 | } | 226 | } |
226 | } | 227 | } |
227 | } else { | 228 | } else { |