Skip to content
Snippets Groups Projects
Commit 6b17ca8e authored by Wan Jiabing's avatar Wan Jiabing Committed by Alex Williamson
Browse files

kvm/vfio: Fix potential deadlock problem in vfio


Fix following coccicheck warning:
./virt/kvm/vfio.c:258:1-7: preceding lock on line 236

If kvm_vfio_file_iommu_group() failed, code would goto err_fdput with
mutex_lock acquired and then return ret. It might cause potential
deadlock. Move mutex_unlock bellow err_fdput tag to fix it.

Fixes: d55d9e7a ("kvm/vfio: Store the struct file in the kvm_vfio_group")
Signed-off-by: default avatarWan Jiabing <wanjiabing@vivo.com>
Reviewed-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20220517023441.4258-1-wanjiabing@vivo.com


Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
parent 1c05bb94
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment