mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-20 12:54:36 +08:00
m68k: handle pgtable_page_ctor() fail
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
7251ab6b86
commit
f84c914b98
@ -56,6 +56,10 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm,
|
|||||||
|
|
||||||
if (!page)
|
if (!page)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
if (!pgtable_page_ctor(page)) {
|
||||||
|
__free_page(page);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
pte = kmap(page);
|
pte = kmap(page);
|
||||||
if (pte) {
|
if (pte) {
|
||||||
|
@ -29,18 +29,22 @@ static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
|
|||||||
|
|
||||||
static inline pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address)
|
static inline pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address)
|
||||||
{
|
{
|
||||||
struct page *page = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0);
|
struct page *page;
|
||||||
pte_t *pte;
|
pte_t *pte;
|
||||||
|
|
||||||
|
page = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0);
|
||||||
if(!page)
|
if(!page)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
if (!pgtable_page_ctor(page)) {
|
||||||
|
__free_page(page);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
pte = kmap(page);
|
pte = kmap(page);
|
||||||
__flush_page_to_ram(pte);
|
__flush_page_to_ram(pte);
|
||||||
flush_tlb_kernel_page(pte);
|
flush_tlb_kernel_page(pte);
|
||||||
nocache_page(pte);
|
nocache_page(pte);
|
||||||
kunmap(page);
|
kunmap(page);
|
||||||
pgtable_page_ctor(page);
|
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,10 @@ static inline pgtable_t pte_alloc_one(struct mm_struct *mm,
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
clear_highpage(page);
|
clear_highpage(page);
|
||||||
pgtable_page_ctor(page);
|
if (!pgtable_page_ctor(page)) {
|
||||||
|
__free_page(page);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
return page;
|
return page;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user