mmap: call unlink_anon_vmas() in __split_vma() in case of error

If __split_vma fails because of an out of memory condition the
anon_vma_chain isn't teardown and freed potentially leading to rmap walks
accessing freed vma information plus there's a memleak.

Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Acked-by: Johannes Weiner <jweiner@redhat.com>
Acked-by: Rik van Riel <riel@redhat.com>
Acked-by: Hugh Dickins <hughd@google.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by Andrea Arcangeli and committed by Linus Torvalds 2aeadc30 a247c3a9

+1
+1
mm/mmap.c
··· 2009 2009 removed_exe_file_vma(mm); 2010 2010 fput(new->vm_file); 2011 2011 } 2012 + unlink_anon_vmas(new); 2012 2013 out_free_mpol: 2013 2014 mpol_put(pol); 2014 2015 out_free_vma: