fremap: get rid of broken 'end' variable

Thomas Pollet points out that the 'end' variable is broken. It was
computed based on start/size before they were page-aligned, and as such
doesn't actually match any of the other actions we take. The overflow
test on end was also redundant, since we had already tested it with the
properly aligned version.

So just get rid of it entirely. The one remaining use for that broken
variable can just use 'start+size' like all the other cases already did.

Reported-by: Thomas Pollet <thomas.pollet@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

+1 -2
+1 -2
mm/fremap.c
··· 125 { 126 struct mm_struct *mm = current->mm; 127 struct address_space *mapping; 128 - unsigned long end = start + size; 129 struct vm_area_struct *vma; 130 int err = -EINVAL; 131 int has_write_lock = 0; ··· 167 if (!(vma->vm_flags & VM_CAN_NONLINEAR)) 168 goto out; 169 170 - if (end <= start || start < vma->vm_start || end > vma->vm_end) 171 goto out; 172 173 /* Must set VM_NONLINEAR before any pages are populated. */
··· 125 { 126 struct mm_struct *mm = current->mm; 127 struct address_space *mapping; 128 struct vm_area_struct *vma; 129 int err = -EINVAL; 130 int has_write_lock = 0; ··· 168 if (!(vma->vm_flags & VM_CAN_NONLINEAR)) 169 goto out; 170 171 + if (start < vma->vm_start || start + size > vma->vm_end) 172 goto out; 173 174 /* Must set VM_NONLINEAR before any pages are populated. */