Skip to content

Commit 478cf8c

Browse files
kiryltorvalds
authored andcommitted
sh: handle pgtable_page_ctor() fail
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 96da3a6 commit 478cf8c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎arch/sh/include/asm/pgalloc.h‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ static inline pgtable_t pte_alloc_one(struct mm_struct *mm,
4747
if (!pg)
4848
return NULL;
4949
page = virt_to_page(pg);
50-
pgtable_page_ctor(page);
50+
if (!pgtable_page_ctor(page)) {
51+
quicklist_free(QUICK_PT, NULL, pg);
52+
return NULL;
53+
}
5154
return page;
5255
}
5356

0 commit comments

Comments
 (0)