From: Kirill A. Shutemov Date: Thu, 14 Nov 2013 22:31:27 +0000 (-0800) Subject: arm64: handle pgtable_page_ctor() fail X-Git-Tag: MMI-PSA29.97-13-9~13278^2~47 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d97a22913808b191c95fbfc51e6405c4504979e6;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git arm64: handle pgtable_page_ctor() fail Signed-off-by: Kirill A. Shutemov Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/arm64/include/asm/pgalloc.h b/arch/arm64/include/asm/pgalloc.h index f214069ec5d5..9bea6e74a001 100644 --- a/arch/arm64/include/asm/pgalloc.h +++ b/arch/arm64/include/asm/pgalloc.h @@ -63,9 +63,12 @@ pte_alloc_one(struct mm_struct *mm, unsigned long addr) struct page *pte; pte = alloc_pages(PGALLOC_GFP, 0); - if (pte) - pgtable_page_ctor(pte); - + if (!pte) + return NULL; + if (!pgtable_page_ctor(pte)) { + __free_page(pte); + return NULL; + } return pte; }