avr32: handle pgtable_page_ctor() fail
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Thu, 14 Nov 2013 22:31:28 +0000 (14:31 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 15 Nov 2013 00:32:17 +0000 (09:32 +0900)
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/avr32/include/asm/pgalloc.h

index bc7e8ae479ee4f7f9be717cbcd38d0731773a6f9..1aba19d68c5ededf4ce986340bf410bb8e05eb3e 100644 (file)
@@ -68,7 +68,10 @@ static inline pgtable_t pte_alloc_one(struct mm_struct *mm,
                return NULL;
 
        page = virt_to_page(pg);
-       pgtable_page_ctor(page);
+       if (!pgtable_page_ctor(page)) {
+               quicklist_free(QUICK_PT, NULL, pg);
+               return NULL;
+       }
 
        return page;
 }