Merge tag 'ide-5.11-2021-02-28' of git://git.kernel.dk/linux-block
[linux-2.6-microblaze.git] / drivers / vfio / vfio.c
index 4ad8a35..38779e6 100644 (file)
@@ -1220,6 +1220,11 @@ static int vfio_fops_open(struct inode *inode, struct file *filep)
 static int vfio_fops_release(struct inode *inode, struct file *filep)
 {
        struct vfio_container *container = filep->private_data;
+       struct vfio_iommu_driver *driver = container->iommu_driver;
+
+       if (driver && driver->ops->notify)
+               driver->ops->notify(container->iommu_data,
+                                   VFIO_IOMMU_CONTAINER_CLOSE);
 
        filep->private_data = NULL;