summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>2013-11-14 14:31:26 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-15 09:32:16 +0900
commitaffce5089a82a045274def17b44b13d10ab7c1d4 (patch)
tree2503c11b13777987f93cf198375c8402e2f20d78
parentca6ec3bbaaaf5941e970314a2eb3680b9e7e698a (diff)
downloadblackbird-op-linux-affce5089a82a045274def17b44b13d10ab7c1d4.tar.gz
blackbird-op-linux-affce5089a82a045274def17b44b13d10ab7c1d4.zip
arm: handle pgtable_page_ctor() fail
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Russell King <linux@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/arm/include/asm/pgalloc.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/arm/include/asm/pgalloc.h b/arch/arm/include/asm/pgalloc.h
index 943504f53f57..78a779361682 100644
--- a/arch/arm/include/asm/pgalloc.h
+++ b/arch/arm/include/asm/pgalloc.h
@@ -102,12 +102,14 @@ pte_alloc_one(struct mm_struct *mm, unsigned long addr)
#else
pte = alloc_pages(PGALLOC_GFP, 0);
#endif
- if (pte) {
- if (!PageHighMem(pte))
- clean_pte_table(page_address(pte));
- pgtable_page_ctor(pte);
+ if (!pte)
+ return NULL;
+ if (!PageHighMem(pte))
+ clean_pte_table(page_address(pte));
+ if (!pgtable_page_ctor(pte)) {
+ __free_page(pte);
+ return NULL;
}
-
return pte;
}
OpenPOWER on IntegriCloud