mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-03 17:51:57 +09:00
Merge tag 'vfio-v5.8-rc7' of git://github.com/awilliam/linux-vfio into master
Pull VFIO fix from Alex Williamson: "Fix race with eventfd ctx cleared outside of mutex (Zeng Tao)" * tag 'vfio-v5.8-rc7' of git://github.com/awilliam/linux-vfio: vfio/pci: fix racy on error and request eventfd ctx
This commit is contained in:
@@ -521,14 +521,19 @@ static void vfio_pci_release(void *device_data)
|
||||
vfio_pci_vf_token_user_add(vdev, -1);
|
||||
vfio_spapr_pci_eeh_release(vdev->pdev);
|
||||
vfio_pci_disable(vdev);
|
||||
mutex_lock(&vdev->igate);
|
||||
if (vdev->err_trigger) {
|
||||
eventfd_ctx_put(vdev->err_trigger);
|
||||
vdev->err_trigger = NULL;
|
||||
}
|
||||
mutex_unlock(&vdev->igate);
|
||||
|
||||
mutex_lock(&vdev->igate);
|
||||
if (vdev->req_trigger) {
|
||||
eventfd_ctx_put(vdev->req_trigger);
|
||||
vdev->req_trigger = NULL;
|
||||
}
|
||||
mutex_unlock(&vdev->igate);
|
||||
}
|
||||
|
||||
mutex_unlock(&vdev->reflck->lock);
|
||||
|
||||
Reference in New Issue
Block a user