summaryrefslogtreecommitdiffstats
path: root/arch/um
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>2013-11-14 23:31:44 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-15 01:32:19 +0100
commit647f884e67dd920e01046a1ae87aa2c2d315479a (patch)
treebd1b5f7fdb236a3041d27e41f37cd011e77499b0 /arch/um
parenttile: handle pgtable_page_ctor() fail (diff)
downloadlinux-647f884e67dd920e01046a1ae87aa2c2d315479a.tar.xz
linux-647f884e67dd920e01046a1ae87aa2c2d315479a.zip
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.c8
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)
struct page *pte;
pte = alloc_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
- if (pte)
- pgtable_page_ctor(pte);
+ if (!pte)
+ return NULL;
+ if (!pgtable_page_ctor(pte)) {
+ __free_page(pte);
+ return NULL;
+ }
return pte;
}