From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Kirill A. Shutemov" Subject: [PATCH 12/34] arm64: handle pgtable_page_ctor() fail Date: Thu, 10 Oct 2013 21:05:37 +0300 Message-ID: <1381428359-14843-13-git-send-email-kirill.shutemov@linux.intel.com> References: <1381428359-14843-1-git-send-email-kirill.shutemov@linux.intel.com> Return-path: In-Reply-To: <1381428359-14843-1-git-send-email-kirill.shutemov@linux.intel.com> Sender: owner-linux-mm@kvack.org To: Andrew Morton , Peter Zijlstra , Ingo Molnar Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, "Kirill A. Shutemov" , Catalin Marinas , Will Deacon List-Id: linux-arch.vger.kernel.org Signed-off-by: Kirill A. Shutemov Cc: Catalin Marinas Cc: Will Deacon --- arch/arm64/include/asm/pgalloc.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/arm64/include/asm/pgalloc.h b/arch/arm64/include/asm/pgalloc.h index f214069ec5..9bea6e74a0 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; } -- 1.8.4.rc3 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com ([134.134.136.24]:16274 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755880Ab3JJSGJ (ORCPT ); Thu, 10 Oct 2013 14:06:09 -0400 From: "Kirill A. Shutemov" Subject: [PATCH 12/34] arm64: handle pgtable_page_ctor() fail Date: Thu, 10 Oct 2013 21:05:37 +0300 Message-ID: <1381428359-14843-13-git-send-email-kirill.shutemov@linux.intel.com> In-Reply-To: <1381428359-14843-1-git-send-email-kirill.shutemov@linux.intel.com> References: <1381428359-14843-1-git-send-email-kirill.shutemov@linux.intel.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Andrew Morton , Peter Zijlstra , Ingo Molnar Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, "Kirill A. Shutemov" , Catalin Marinas , Will Deacon Message-ID: <20131010180537.js8Sv6gP65r6oJiC_A45w8BoJkmDfyxmWZc83Q0Qruo@z> Signed-off-by: Kirill A. Shutemov Cc: Catalin Marinas Cc: Will Deacon --- arch/arm64/include/asm/pgalloc.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/arm64/include/asm/pgalloc.h b/arch/arm64/include/asm/pgalloc.h index f214069ec5..9bea6e74a0 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; } -- 1.8.4.rc3