Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hexagon: handle pgtable_page_ctor() fail

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Richard Kuo <rkuo@codeaurora.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Kirill A. Shutemov and committed by
Linus Torvalds
5de1423d 3b9cf77d

+6 -4
+6 -4
arch/hexagon/include/asm/pgalloc.h
··· 65 65 struct page *pte; 66 66 67 67 pte = alloc_page(GFP_KERNEL | __GFP_REPEAT | __GFP_ZERO); 68 - 69 - if (pte) 70 - pgtable_page_ctor(pte); 71 - 68 + if (!pte) 69 + return NULL; 70 + if (!pgtable_page_ctor(pte)) { 71 + __free_page(pte); 72 + return NULL; 73 + } 72 74 return pte; 73 75 } 74 76