Commit e90bedbb authored by Kirill A. Shutemov's avatar Kirill A. Shutemov Committed by Linus Torvalds

unicore32: handle pgtable_page_ctor() fail

Signed-off-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 647f884e
...@@ -51,12 +51,14 @@ pte_alloc_one(struct mm_struct *mm, unsigned long addr) ...@@ -51,12 +51,14 @@ pte_alloc_one(struct mm_struct *mm, unsigned long addr)
struct page *pte; struct page *pte;
pte = alloc_pages(PGALLOC_GFP, 0); pte = alloc_pages(PGALLOC_GFP, 0);
if (pte) { if (!pte)
if (!PageHighMem(pte)) { return NULL;
void *page = page_address(pte); if (!PageHighMem(pte)) {
clean_dcache_area(page, PTRS_PER_PTE * sizeof(pte_t)); void *page = page_address(pte);
} clean_dcache_area(page, PTRS_PER_PTE * sizeof(pte_t));
pgtable_page_ctor(pte); }
if (!pgtable_page_ctor(pte)) {
__free_page(pte);
} }
return pte; return pte;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment