sparc64: Fix size check in huge_pte_alloc

Message ID 1488580854-92578-1-git-send-email-nitin.m.gupta@oracle.com
State Accepted
Delegated to: David Miller
Headers show

Commit Message

Nitin Gupta March 3, 2017, 10:40 p.m.
Signed-off-by: Nitin Gupta <nitin.m.gupta@oracle.com>
---
 arch/sparc/mm/hugetlbpage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller March 28, 2017, 4:37 a.m. | #1
From: Nitin Gupta <nitin.m.gupta@oracle.com>
Date: Fri,  3 Mar 2017 14:40:44 -0800

> Signed-off-by: Nitin Gupta <nitin.m.gupta@oracle.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/arch/sparc/mm/hugetlbpage.c b/arch/sparc/mm/hugetlbpage.c
index 323bc6b..3016850 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);