提交 a4c28ab7 编写于 作者: A Akinobu Mita 提交者: Paul Mackerras

[POWERPC] Fix return from pte_alloc_one() in out-of-memory case

pte_alloc_one() is expected to return NULL if out of memory.
But it returns virt_to_page(NULL), which is not NULL.
This fixes it.

Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: NAkinobu Mita <mita@fixstars.com>
Signed-off-by: NPaul Mackerras <paulus@samba.org>
上级 66b30922
......@@ -90,7 +90,8 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
static inline struct page *pte_alloc_one(struct mm_struct *mm,
unsigned long address)
{
return virt_to_page(pte_alloc_one_kernel(mm, address));
pte_t *pte = pte_alloc_one_kernel(mm, address);
return pte ? virt_to_page(pte) : NULL;
}
static inline void pte_free_kernel(pte_t *pte)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册