The nommu split_vma() ignores the result of vm_ops->open(). Fail with -ENOMEM like its other failure paths, nothing has been changed in the original VMA or its region yet. Signed-off-by: Josef Bacik --- mm/nommu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mm/nommu.c b/mm/nommu.c index df99495c8902..cd4ebac74dd2 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -1373,8 +1373,10 @@ static int split_vma(struct vma_iterator *vmi, struct vm_area_struct *vma, goto err_vmi_preallocate; } - if (new->vm_ops && new->vm_ops->open) - new->vm_ops->open(new); + if (vma_open(new)) { + vma_iter_free(vmi); + goto err_vmi_preallocate; + } down_write(&nommu_region_sem); delete_nommu_region(vma->vm_region); -- 2.55.0