diff options
-rw-r--r-- | arch/s390/mm/pgtable.c | 11 |
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); |