Skip to content

Commit 6e7f2ea

Browse files
committed
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 fix from Catalin Marinas: "Avoid potential NULL dereference in huge_pte_alloc() on pmd_alloc() failure" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: hugetlb: avoid potential NULL dereference
2 parents 8c16ec9 + 027d0c7 commit 6e7f2ea

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/arm64/mm/hugetlbpage.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ pte_t *huge_pte_alloc(struct mm_struct *mm,
230230
ptep = (pte_t *)pudp;
231231
} else if (sz == (CONT_PTE_SIZE)) {
232232
pmdp = pmd_alloc(mm, pudp, addr);
233+
if (!pmdp)
234+
return NULL;
233235

234236
WARN_ON(addr & (sz - 1));
235237
/*

0 commit comments

Comments
 (0)