Commit 2da64d20 authored by Alexey Kardashevskiy's avatar Alexey Kardashevskiy Committed by Alex Williamson

vfio/spapr: Fix missing mutex unlock when creating a window

Commit d9c72894 ("vfio/spapr: Postpone default window creation")
added an additional exit to the VFIO_IOMMU_SPAPR_TCE_CREATE case and
made it possible to return from tce_iommu_ioctl() without unlocking
container->lock; this fixes the issue.

Fixes: d9c72894 ("vfio/spapr: Postpone default window creation")
Signed-off-by: default avatarAlexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
parent 566cf877
...@@ -1123,10 +1123,9 @@ static long tce_iommu_ioctl(void *iommu_data, ...@@ -1123,10 +1123,9 @@ static long tce_iommu_ioctl(void *iommu_data,
mutex_lock(&container->lock); mutex_lock(&container->lock);
ret = tce_iommu_create_default_window(container); ret = tce_iommu_create_default_window(container);
if (ret) if (!ret)
return ret; ret = tce_iommu_create_window(container,
create.page_shift,
ret = tce_iommu_create_window(container, create.page_shift,
create.window_size, create.levels, create.window_size, create.levels,
&create.start_addr); &create.start_addr);
......
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