Commit 7df4e81
drm/i915/gvt: Get reference to KVM iff attachment to VM is successful
Get a reference to KVM if and only if a vGPU is successfully attached to
the VM to avoid leaking a reference if there's no available vGPU. On
open_device() failure, vfio_device_open() doesn't invoke close_device().
Fixes: 421cfe6 ("vfio: remove VFIO_GROUP_NOTIFY_SET_KVM")
Cc: stable@vger.kernel.org
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20221111002225.2418386-2-seanjc@google.com1 parent 7306260 commit 7df4e81
1 file changed
+1
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
664 | 664 | | |
665 | 665 | | |
666 | 666 | | |
667 | | - | |
668 | | - | |
669 | 667 | | |
670 | 668 | | |
671 | 669 | | |
| |||
676 | 674 | | |
677 | 675 | | |
678 | 676 | | |
| 677 | + | |
679 | 678 | | |
680 | 679 | | |
681 | 680 | | |
| |||
0 commit comments