From: Andrea Arcangeli Date: Wed, 24 Aug 2011 23:47:19 +0000 (+1000) Subject: Signed-off-by: Andrew Morton X-Git-Tag: next-20110909~1^2~55 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a0656fb06d2de39723b17e3965d3a73d1c57f12f;p=karo-tx-linux.git Signed-off-by: Andrew Morton --- diff --git a/mm/huge_memory.c b/mm/huge_memory.c index fffab174f3e7..6b072bdccf81 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -1064,7 +1064,7 @@ int move_huge_pmd(struct vm_area_struct *vma, struct vm_area_struct *new_vma, if ((old_addr & ~HPAGE_PMD_MASK) || (new_addr & ~HPAGE_PMD_MASK) || - (old_addr + HPAGE_PMD_SIZE) > old_end || + old_end - old_addr < HPAGE_PMD_SIZE || (new_vma->vm_flags & VM_NOHUGEPAGE)) goto out;