mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-25 15:02:13 +00:00
hypervisor/ivshmem: Add ivshmem_dev_lock to protect deinit
Add the ivshmem_dev_lock to protect races between release and allocations. Tracked-On: ##8486 Signed-off-by: Zhang Chen <chen.zhang@intel.com> Reviewed-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
parent
c9c0d2167b
commit
45382dca4b
@ -355,9 +355,12 @@ static void deinit_ivshmem_vdev(struct pci_vdev *vdev)
|
||||
struct ivshmem_device *ivs_dev = (struct ivshmem_device *) vdev->priv_data;
|
||||
|
||||
ivshmem_server_unbind_peer(vdev);
|
||||
ivs_dev->pcidev = NULL;
|
||||
|
||||
spinlock_obtain(&ivshmem_dev_lock);
|
||||
vdev->priv_data = NULL;
|
||||
vdev->user = NULL;
|
||||
ivs_dev->pcidev = NULL;
|
||||
spinlock_release(&ivshmem_dev_lock);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user