From: Nitin Gupta Date: Fri, 3 Mar 2017 22:40:44 +0000 (-0800) Subject: sparc64: Fix size check in huge_pte_alloc X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=59f1183dd368f12c0a80da3c91a4a42afa4e1d38;p=openwrt%2Fstaging%2Fblogic.git sparc64: Fix size check in huge_pte_alloc Signed-off-by: Nitin Gupta Signed-off-by: David S. Miller --- diff --git a/arch/sparc/mm/hugetlbpage.c b/arch/sparc/mm/hugetlbpage.c index 323bc6b6e3ad..30168500603e 100644 --- a/arch/sparc/mm/hugetlbpage.c +++ b/arch/sparc/mm/hugetlbpage.c @@ -261,7 +261,7 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, if (!pmd) return NULL; - if (sz == PMD_SHIFT) + if (sz >= PMD_SIZE) pte = (pte_t *)pmd; else pte = pte_alloc_map(mm, pmd, addr);