[patch 087/100] KVM: fix kvm_vm_ioctl_deassign_device

Chris Wright
2009-04-23T07:56:36Z

[-- Attachment #1: kvm-fix-kvm_vm_ioctl_deassign_device.patch --]
[-- Type: text/plain, Size: 884 bytes --]

-stable review patch. If anyone has any objections, please let us know.
---------------------

From: Weidong Han <weidong.han@intel.com>

upstream commit: 4a906e49f103c2e544148a209ba1db316510799f

only need to set assigned_dev_id for deassignment, use
match->flags to judge and deassign it.

Acked-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
virt/kvm/kvm_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -563,7 +563,7 @@ static int kvm_vm_ioctl_deassign_device(
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);