aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arc
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>2013-11-14 17:31:25 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-14 19:32:16 -0500
commitca6ec3bbaaaf5941e970314a2eb3680b9e7e698a (patch)
tree8a022056ae218eb513e7ddd5b3f84764260a71ba /arch/arc
parent3fd681b68cd34eacb106b25fcb10bb202a3232c5 (diff)
arc: handle pgtable_page_ctor() fail
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Acked-by: Vineet Gupta <vgupta@synopsys.com> [for arch/arc bits] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/arc')
-rw-r--r--arch/arc/include/asm/pgalloc.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/arch/arc/include/asm/pgalloc.h b/arch/arc/include/asm/pgalloc.h
index 36a9f20c21a3..81208bfd9dcb 100644
--- a/arch/arc/include/asm/pgalloc.h
+++ b/arch/arc/include/asm/pgalloc.h
@@ -105,11 +105,16 @@ static inline pgtable_t
105pte_alloc_one(struct mm_struct *mm, unsigned long address) 105pte_alloc_one(struct mm_struct *mm, unsigned long address)
106{ 106{
107 pgtable_t pte_pg; 107 pgtable_t pte_pg;
108 struct page *page;
108 109
109 pte_pg = __get_free_pages(GFP_KERNEL | __GFP_REPEAT, __get_order_pte()); 110 pte_pg = __get_free_pages(GFP_KERNEL | __GFP_REPEAT, __get_order_pte());
110 if (pte_pg) { 111 if (!pte_pg)
111 memzero((void *)pte_pg, PTRS_PER_PTE * 4); 112 return 0;
112 pgtable_page_ctor(virt_to_page(pte_pg)); 113 memzero((void *)pte_pg, PTRS_PER_PTE * 4);
114 page = virt_to_page(pte_pg);
115 if (!pgtable_page_ctor(page)) {
116 __free_page(page);
117 return 0;
113 } 118 }
114 119
115 return pte_pg; 120 return pte_pg;