Handle migrate_vma_setup() failure via goto err for unified cleanup.
Link: https://lore.kernel.org/20260515070312.130435-1-liuqiangneo@163.com
Signed-off-by: Qiang Liu <liuqiang@kylinos.cn>
Reviewed-by: Alistair Popple <apopple@nvidia.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
if (order)
args.flags |= MIGRATE_VMA_SELECT_COMPOUND;
- if (migrate_vma_setup(&args))
- return VM_FAULT_SIGBUS;
+ /*
+ * In practice migrate_vma_setup() should never fail unless the
+ * test is wrong as it just tests some static VMA properties.
+ */
+ if (migrate_vma_setup(&args)) {
+ ret = VM_FAULT_SIGBUS;
+ goto err;
+ }
ret = dmirror_devmem_fault_alloc_and_copy(&args, dmirror);
if (ret)