From: Weidong Han Date: Fri, 13 Feb 2009 09:27:51 +0000 (+0800) Subject: KVM: fix kvm_vm_ioctl_deassign_device X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=4a906e49f103c2e544148a209ba1db316510799f;p=linux-2.6-omap-h63xx.git KVM: fix kvm_vm_ioctl_deassign_device only need to set assigned_dev_id for deassignment, use match->flags to judge and deassign it. Acked-by: Mark McLoughlin Signed-off-by: Weidong Han Signed-off-by: Avi Kivity --- diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 0ed662dc72d..c4278975c8c 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -517,7 +517,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);