summaryrefslogtreecommitdiffstats
path: root/arch/um/kernel
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>2013-11-14 14:31:44 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-15 09:32:19 +0900
commit647f884e67dd920e01046a1ae87aa2c2d315479a (patch)
treebd1b5f7fdb236a3041d27e41f37cd011e77499b0 /arch/um/kernel
parent76b3aec332e74596c517e1198764a5aeb8ea8398 (diff)
downloadop-kernel-dev-647f884e67dd920e01046a1ae87aa2c2d315479a.zip
op-kernel-dev-647f884e67dd920e01046a1ae87aa2c2d315479a.tar.gz
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/kernel')
-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 7ddb64b..8636e90 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;
}
OpenPOWER on IntegriCloud