summaryrefslogtreecommitdiff
path: root/arch/powerpc/mm/kasan
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@c-s.fr>2020-01-14 17:54:04 +0000
committerMichael Ellerman <mpe@ellerman.id.au>2020-01-27 22:37:45 +1100
commit21613cfad181c882b1effd227dcfbddc61dc80f7 (patch)
tree8026060f9e7643e9317c0392d54b5cab0889a65d /arch/powerpc/mm/kasan
parent509cd3f2b473330238c768bb21a4f2cdc80393fa (diff)
powerpc/32: Reuse orphaned memblocks in kasan_init_shadow_page_tables()
If concurrent PMD population has happened, re-use orphaned memblocks. Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/b29ffffb9206dc14541fa420c17604240728041b.1579024426.git.christophe.leroy@c-s.fr
Diffstat (limited to 'arch/powerpc/mm/kasan')
-rw-r--r--arch/powerpc/mm/kasan/kasan_init_32.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/powerpc/mm/kasan/kasan_init_32.c b/arch/powerpc/mm/kasan/kasan_init_32.c
index c4bf9ed04f88..d3cacd462560 100644
--- a/arch/powerpc/mm/kasan/kasan_init_32.c
+++ b/arch/powerpc/mm/kasan/kasan_init_32.c
@@ -34,17 +34,17 @@ static int __init kasan_init_shadow_page_tables(unsigned long k_start, unsigned
{
pmd_t *pmd;
unsigned long k_cur, k_next;
+ pte_t *new = NULL;
pmd = pmd_offset(pud_offset(pgd_offset_k(k_start), k_start), k_start);
for (k_cur = k_start; k_cur != k_end; k_cur = k_next, pmd++) {
- pte_t *new;
-
k_next = pgd_addr_end(k_cur, k_end);
if ((void *)pmd_page_vaddr(*pmd) != kasan_early_shadow_pte)
continue;
- new = memblock_alloc(PTE_FRAG_SIZE, PTE_FRAG_SIZE);
+ if (!new)
+ new = memblock_alloc(PTE_FRAG_SIZE, PTE_FRAG_SIZE);
if (!new)
return -ENOMEM;