mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
lib/test_hmm: fix error path in dmirror_devmem_fault()
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>
This commit is contained in:
parent
0c946c54a7
commit
6fa411adff
|
|
@ -1679,8 +1679,14 @@ static vm_fault_t dmirror_devmem_fault(struct vm_fault *vmf)
|
|||
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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user