Commit e1907d67 authored by Xiang Zheng's avatar Xiang Zheng Committed by Alex Williamson

vfio/type1: Add conditional rescheduling after iommu map failed

Commit c5e66887 ("vfio/type1: Add conditional rescheduling")
missed a "cond_resched()" in vfio_iommu_map if iommu map failed.

This is a very tiny optimization and the case can hardly happen.
Signed-off-by: default avatarXiang Zheng <zhengxiang9@huawei.com>
Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
parent bf3551e1
......@@ -1225,8 +1225,10 @@ static int vfio_iommu_map(struct vfio_iommu *iommu, dma_addr_t iova,
return 0;
unwind:
list_for_each_entry_continue_reverse(d, &iommu->domain_list, next)
list_for_each_entry_continue_reverse(d, &iommu->domain_list, next) {
iommu_unmap(d->domain, iova, npage << PAGE_SHIFT);
cond_resched();
}
return ret;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment