aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>2013-11-14 17:31:39 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-14 19:32:18 -0500
commite89cfa58a8358fdb4d4e79936c25222416ad415e (patch)
tree55ff424692ee34c8f1fa60c1366b10afde1dfde7
parent4f804943f99454ac79e0f448428447f1a72d09fc (diff)
s390: handle pgtable_page_ctor() fail
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/s390/mm/pgtable.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
index 1ea18fcfa211..e794c88f699a 100644
--- a/arch/s390/mm/pgtable.c
+++ b/arch/s390/mm/pgtable.c
@@ -772,7 +772,11 @@ static inline unsigned long *page_table_alloc_pgste(struct mm_struct *mm,
772 __free_page(page); 772 __free_page(page);
773 return NULL; 773 return NULL;
774 } 774 }
775 pgtable_page_ctor(page); 775 if (!pgtable_page_ctor(page)) {
776 kfree(mp);
777 __free_page(page);
778 return NULL;
779 }
776 mp->vmaddr = vmaddr & PMD_MASK; 780 mp->vmaddr = vmaddr & PMD_MASK;
777 INIT_LIST_HEAD(&mp->mapper); 781 INIT_LIST_HEAD(&mp->mapper);
778 page->index = (unsigned long) mp; 782 page->index = (unsigned long) mp;
@@ -902,7 +906,10 @@ unsigned long *page_table_alloc(struct mm_struct *mm, unsigned long vmaddr)
902 page = alloc_page(GFP_KERNEL|__GFP_REPEAT); 906 page = alloc_page(GFP_KERNEL|__GFP_REPEAT);
903 if (!page) 907 if (!page)
904 return NULL; 908 return NULL;
905 pgtable_page_ctor(page); 909 if (!pgtable_page_ctor(page)) {
910 __free_page(page);
911 return NULL;
912 }
906 atomic_set(&page->_mapcount, 1); 913 atomic_set(&page->_mapcount, 1);
907 table = (unsigned long *) page_to_phys(page); 914 table = (unsigned long *) page_to_phys(page);
908 clear_table(table, _PAGE_INVALID, PAGE_SIZE); 915 clear_table(table, _PAGE_INVALID, PAGE_SIZE);