diff options
author | Kirill A. Shutemov <kirill.shutemov@linux.intel.com> | 2013-11-14 17:31:44 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-14 19:32:19 -0500 |
commit | 647f884e67dd920e01046a1ae87aa2c2d315479a (patch) | |
tree | bd1b5f7fdb236a3041d27e41f37cd011e77499b0 /arch/um | |
parent | 76b3aec332e74596c517e1198764a5aeb8ea8398 (diff) |
um: handle pgtable_page_ctor() fail
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Richard Weinberger <richard@nod.at>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um')
-rw-r--r-- | arch/um/kernel/mem.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c index 7ddb64baf327..8636e905426f 100644 --- a/arch/um/kernel/mem.c +++ b/arch/um/kernel/mem.c | |||
@@ -279,8 +279,12 @@ pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address) | |||
279 | struct page *pte; | 279 | struct page *pte; |
280 | 280 | ||
281 | pte = alloc_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); | 281 | pte = alloc_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); |
282 | if (pte) | 282 | if (!pte) |
283 | pgtable_page_ctor(pte); | 283 | return NULL; |
284 | if (!pgtable_page_ctor(pte)) { | ||
285 | __free_page(pte); | ||
286 | return NULL; | ||
287 | } | ||
284 | return pte; | 288 | return pte; |
285 | } | 289 | } |
286 | 290 | ||