mm/nommu: fix error handling in split_vma()
The memory allocated before calling mas_preallocate() is leaked if it
fails. 'mas' won't be modify until calling mas_preallocate(), so move it
up and add error label for free the memory.
Link: https://lkml.kernel.org/r/20220824042424.2031508-1-yangyingliang@huawei.com
Fixes: 8aff7dbeaeb1 ("nommu: remove uses of VMA linked list")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>