only need to set assigned_dev_id for deassignment, use match->flags to judge and deassign it. Acked-by: Mark McLoughlin <markmc@xxxxxxxxxx> Signed-off-by: Weidong Han <weidong.han@xxxxxxxxx> --- virt/kvm/kvm_main.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index ef52622..3aacdb9 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -574,7 +574,7 @@ static int kvm_vm_ioctl_deassign_device(struct kvm *kvm, goto out; } - if (assigned_dev->flags & KVM_DEV_ASSIGN_ENABLE_IOMMU) + if (match->flags & KVM_DEV_ASSIGN_ENABLE_IOMMU) kvm_deassign_device(kvm, match); kvm_free_assigned_device(kvm, match); -- 1.6.0.4
Attachment:
0002-kvm-fix-kvm_vm_ioctl_deassign_device.patch
Description: 0002-kvm-fix-kvm_vm_ioctl_deassign_device.patch