From: Kirill A. Shutemov Date: Thu, 14 Nov 2013 22:31:48 +0000 (-0800) Subject: xtensa: handle pgtable_page_ctor() fail X-Git-Tag: v4.0~2934^2~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8f43123d170ad9a6760e424af5bde7569fdd8c12;p=platform%2Fkernel%2Flinux-amlogic.git xtensa: handle pgtable_page_ctor() fail Signed-off-by: Kirill A. Shutemov Cc: Chris Zankel Cc: Max Filippov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/xtensa/include/asm/pgalloc.h b/arch/xtensa/include/asm/pgalloc.h index 037671a..b8774f1 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; }