Skip to content

Commit

Permalink
tile: handle pgtable_page_ctor() fail
Browse files Browse the repository at this point in the history
Signed-off-by: Kirill A. Shutemov <[email protected]>
Acked-by: Chris Metcalf <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
kiryl authored and torvalds committed Nov 15, 2013
1 parent 1ae9ae5 commit 76b3aec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion arch/tile/mm/pgtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,11 @@ struct page *pgtable_alloc_one(struct mm_struct *mm, unsigned long address,
if (p == NULL)
return NULL;

if (!pgtable_page_ctor(p)) {
__free_pages(p, L2_USER_PGTABLE_ORDER);
return NULL;
}

/*
* Make every page have a page_count() of one, not just the first.
* We don't use __GFP_COMP since it doesn't look like it works
Expand All @@ -251,7 +256,6 @@ struct page *pgtable_alloc_one(struct mm_struct *mm, unsigned long address,
inc_zone_page_state(p+i, NR_PAGETABLE);
}

pgtable_page_ctor(p);
return p;
}

Expand Down

0 comments on commit 76b3aec

Please sign in to comment.