From: Kirill A. Shutemov Date: Thu, 14 Nov 2013 22:31:29 +0000 (-0800) Subject: cris: handle pgtable_page_ctor() fail X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=0da5303bdb55e67963e8b53ebf3a2aa75051cab4;p=openwrt%2Fstaging%2Fblogic.git cris: handle pgtable_page_ctor() fail Signed-off-by: Kirill A. Shutemov Cc: Mikael Starvik Acked-by: Jesper Nilsson Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/cris/include/asm/pgalloc.h b/arch/cris/include/asm/pgalloc.h index d9504d38c276..235ece437ddd 100644 --- a/arch/cris/include/asm/pgalloc.h +++ b/arch/cris/include/asm/pgalloc.h @@ -34,7 +34,10 @@ static inline pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long addres pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0); if (!pte) return NULL; - pgtable_page_ctor(pte); + if (!pgtable_page_ctor(pte)) { + __free_page(pte); + return NULL; + } return pte; }