sparc64: Fix size check in huge_pte_alloc
authorNitin Gupta <nitin.m.gupta@oracle.com>
Fri, 3 Mar 2017 22:40:44 +0000 (14:40 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 28 Mar 2017 04:20:22 +0000 (21:20 -0700)
Signed-off-by: Nitin Gupta <nitin.m.gupta@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/mm/hugetlbpage.c

index 323bc6b6e3ad0eceb0ea4cdb6a1cb6da898227b8..30168500603e82ab4023bee12acee1f4d1ab8c24 100644 (file)
@@ -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);