vfio/spapr: Fix missing mutex unlock when creating a window
[ Upstream commit 2da64d20a0b20046d688e44f4033efd09157e29d ] Commit d9c728949ddc ("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: d9c728949ddc ("vfio/spapr: Postpone default window creation") Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
6129fd9882
commit
3e550debcf
@ -1123,12 +1123,11 @@ 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,
|
||||
create.window_size, create.levels,
|
||||
&create.start_addr);
|
||||
if (!ret)
|
||||
ret = tce_iommu_create_window(container,
|
||||
create.page_shift,
|
||||
create.window_size, create.levels,
|
||||
&create.start_addr);
|
||||
|
||||
mutex_unlock(&container->lock);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user