diff options
author | Kirill A. Shutemov <kirill.shutemov@linux.intel.com> | 2013-11-07 12:09:32 +1100 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2013-11-08 19:17:33 +1100 |
commit | 7b931910587053cd630bab4d0aeaaf8259d36db0 (patch) | |
tree | 4c9c9c33ff7f265428b6b4d83dd70b937e23906a | |
parent | 84bab45c84bebe99145f6e6bc8fa4e0dd1110f4e (diff) |
cris: handle pgtable_page_ctor() fail
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Mikael Starvik <starvik@axis.com>
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r-- | arch/cris/include/asm/pgalloc.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/cris/include/asm/pgalloc.h b/arch/cris/include/asm/pgalloc.h index d9504d38c276..235ece437ddd 100644 --- a/arch/cris/include/asm/pgalloc.h +++ b/arch/cris/include/asm/pgalloc.h @@ -34,7 +34,10 @@ static inline pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long addres pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0); if (!pte) return NULL; - pgtable_page_ctor(pte); + if (!pgtable_page_ctor(pte)) { + __free_page(pte); + return NULL; + } return pte; } |