diff options
author | Kirill A. Shutemov <kirill.shutemov@linux.intel.com> | 2013-11-14 17:31:30 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-14 19:32:17 -0500 |
commit | 3b9cf77d1aad657dd44ab0f0368978e87b64ad23 (patch) | |
tree | 1b679f81ea1557076cf414023d5bd8ecfdf4ffed /arch/frv | |
parent | 0da5303bdb55e67963e8b53ebf3a2aa75051cab4 (diff) |
frv: handle pgtable_page_ctor() fail
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/frv')
-rw-r--r-- | arch/frv/mm/pgalloc.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/frv/mm/pgalloc.c b/arch/frv/mm/pgalloc.c index f6084bc524e8..41907d25ed38 100644 --- a/arch/frv/mm/pgalloc.c +++ b/arch/frv/mm/pgalloc.c | |||
@@ -37,11 +37,15 @@ pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address) | |||
37 | #else | 37 | #else |
38 | page = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0); | 38 | page = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0); |
39 | #endif | 39 | #endif |
40 | if (page) { | 40 | if (!page) |
41 | clear_highpage(page); | 41 | return NULL; |
42 | pgtable_page_ctor(page); | 42 | |
43 | flush_dcache_page(page); | 43 | clear_highpage(page); |
44 | if (!pgtable_page_ctor(page)) { | ||
45 | __free_page(page); | ||
46 | return NULL; | ||
44 | } | 47 | } |
48 | flush_dcache_page(page); | ||
45 | return page; | 49 | return page; |
46 | } | 50 | } |
47 | 51 | ||