Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -1123,10 +1123,9 @@ static long tce_iommu_ioctl(void *iommu_data,
		mutex_lock(&container->lock);

		ret = tce_iommu_create_default_window(container);
		if (ret)
			return ret;

		ret = tce_iommu_create_window(container, create.page_shift,
		if (!ret)
			ret = tce_iommu_create_window(container,
					create.page_shift,
					create.window_size, create.levels,
					&create.start_addr);