diff options
author | Kirill A. Shutemov <[email protected]> | 2013-11-14 14:31:27 -0800 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2013-11-15 09:32:16 +0900 |
commit | d97a22913808b191c95fbfc51e6405c4504979e6 (patch) | |
tree | c5fb74da2b4e726c59b858d77b9fdde8b7d1760e | |
parent | affce5089a82a045274def17b44b13d10ab7c1d4 (diff) |
arm64: handle pgtable_page_ctor() fail
Signed-off-by: Kirill A. Shutemov <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Will Deacon <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r-- | arch/arm64/include/asm/pgalloc.h | 9 |
1 files changed, 6 insertions, 3 deletions
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; } |