Skip to content

Commit bc16640

Browse files
kiryltorvalds
authored andcommitted
parisc: handle pgtable_page_ctor() fail
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: "James E.J. Bottomley" <jejb@parisc-linux.org> Cc: Helge Deller <deller@gmx.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 3b5b51c commit bc16640

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,12 @@ static inline pgtable_t
121121
pte_alloc_one(struct mm_struct *mm, unsigned long address)
122122
{
123123
struct page *page = alloc_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
124-
if (page)
125-
pgtable_page_ctor(page);
124+
if (!page)
125+
return NULL;
126+
if (!pgtable_page_ctor(page)) {
127+
__free_page(page);
128+
return NULL;
129+
}
126130
return page;
127131
}
128132

0 commit comments

Comments
 (0)