if (error)
return error;
- prev = vma;
mas_set(mas, start);
vma = mas_walk(mas);
- prev = mas_prev(mas, 0);
- } else {
- prev = mas_prev(mas, 0);
- if (unlikely((!prev)))
- mas_set(mas, start);
}
+ prev = mas_prev(mas, 0);
+ if (unlikely((!prev)))
+ mas_set(mas, start);
+
/*
* Detach a range of VMAs from the mm. Using next as a temp variable as
* it is always overwritten.
/* Does it split the end? */
if (next->vm_end > end) {
int error;
+ struct vm_area_struct *tmp = next;
error = __split_vma(mm, next, end, 1);
if (error)
return error;
+
mas_set(mas, end);
next = mas_prev(mas, 0);
+ if (tmp == vma)
+ vma = next;
}
count++;
#ifdef CONFIG_DEBUG_VM_MAPLE_TREE