summaryrefslogtreecommitdiffstats
path: root/arch/sparc/mm/srmmu.c
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>2013-11-14 23:31:42 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-15 01:32:19 +0100
commit1ae9ae5f7df726c67736c643c1f03f7bdfe748eb (patch)
treeea4172be40418472c7172de9f8d6e0796a846467 /arch/sparc/mm/srmmu.c
parentsh: handle pgtable_page_ctor() fail (diff)
downloadlinux-1ae9ae5f7df726c67736c643c1f03f7bdfe748eb.tar.xz
linux-1ae9ae5f7df726c67736c643c1f03f7bdfe748eb.zip
sparc: handle pgtable_page_ctor() fail
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to '')
-rw-r--r--arch/sparc/mm/srmmu.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
index 5d721df48a72..869023abe5a4 100644
--- a/arch/sparc/mm/srmmu.c
+++ b/arch/sparc/mm/srmmu.c
@@ -345,7 +345,10 @@ pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address)
if ((pte = (unsigned long)pte_alloc_one_kernel(mm, address)) == 0)
return NULL;
page = pfn_to_page(__nocache_pa(pte) >> PAGE_SHIFT);
- pgtable_page_ctor(page);
+ if (!pgtable_page_ctor(page)) {
+ __free_page(page);
+ return NULL;
+ }
return page;
}