aboutsummaryrefslogtreecommitdiff
path: root/arch/xtensa/include/asm/pgalloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/xtensa/include/asm/pgalloc.h')
-rw-r--r--arch/xtensa/include/asm/pgalloc.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/xtensa/include/asm/pgalloc.h b/arch/xtensa/include/asm/pgalloc.h
index 037671a655d..b8774f1e21e 100644
--- a/arch/xtensa/include/asm/pgalloc.h
+++ b/arch/xtensa/include/asm/pgalloc.h
@@ -58,7 +58,10 @@ static inline pgtable_t pte_alloc_one(struct mm_struct *mm,
if (!pte)
return NULL;
page = virt_to_page(pte);
- pgtable_page_ctor(page);
+ if (!pgtable_page_ctor(page)) {
+ kmem_cache_free(pgtable_cache, pte);
+ return NULL;
+ }
return page;
}