File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -664,8 +664,6 @@ static int intel_vgpu_open_device(struct vfio_device *vfio_dev)
664
664
return - ESRCH ;
665
665
}
666
666
667
- kvm_get_kvm (vgpu -> vfio_device .kvm );
668
-
669
667
if (__kvmgt_vgpu_exist (vgpu ))
670
668
return - EEXIST ;
671
669
@@ -676,6 +674,7 @@ static int intel_vgpu_open_device(struct vfio_device *vfio_dev)
676
674
677
675
vgpu -> track_node .track_write = kvmgt_page_track_write ;
678
676
vgpu -> track_node .track_flush_slot = kvmgt_page_track_flush_slot ;
677
+ kvm_get_kvm (vgpu -> vfio_device .kvm );
679
678
kvm_page_track_register_notifier (vgpu -> vfio_device .kvm ,
680
679
& vgpu -> track_node );
681
680
@@ -715,15 +714,14 @@ static void intel_vgpu_close_device(struct vfio_device *vfio_dev)
715
714
716
715
kvm_page_track_unregister_notifier (vgpu -> vfio_device .kvm ,
717
716
& vgpu -> track_node );
717
+ kvm_put_kvm (vgpu -> vfio_device .kvm );
718
+
718
719
kvmgt_protect_table_destroy (vgpu );
719
720
gvt_cache_destroy (vgpu );
720
721
721
722
intel_vgpu_release_msi_eventfd_ctx (vgpu );
722
723
723
724
vgpu -> attached = false;
724
-
725
- if (vgpu -> vfio_device .kvm )
726
- kvm_put_kvm (vgpu -> vfio_device .kvm );
727
725
}
728
726
729
727
static u64 intel_vgpu_get_bar_addr (struct intel_vgpu * vgpu , int bar )
You can’t perform that action at this time.
0 commit comments