arch_unmap(mm, newbrk, oldbrk);
- if (vma->vm_start >= newbrk) { // remove entire mapping.
- ret = __do_munmap(mm, newbrk, oldbrk - newbrk, &uf, true);
+ if (vma->vm_start >= newbrk) { // remove entire mapping(s)
+ ret = __do_munmap(mm, newbrk, oldbrk-newbrk, uf, true);
goto munmap_full_vma;
}
ret = userfaultfd_unmap_prep(&unmap, newbrk, oldbrk, uf);
if (ret)
return ret;
+ ret = 1;
// Change the oldbrk of vma to the newbrk of the munmap area
vma_adjust_trans_huge(vma, vma->vm_start, newbrk, 0);