forked from Minki/linux
m32r: fix potential NULL-pointer dereference
Add missing check for memory allocation fail. Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Hirokazu Takata <takata@linux-m32r.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
26db39027c
commit
fecf3743b8
@ -43,6 +43,8 @@ static __inline__ pgtable_t pte_alloc_one(struct mm_struct *mm,
|
||||
{
|
||||
struct page *pte = alloc_page(GFP_KERNEL|__GFP_ZERO);
|
||||
|
||||
if (!pte)
|
||||
return NULL;
|
||||
pgtable_page_ctor(pte);
|
||||
return pte;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user