-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Weidong Han <[email protected]>
upstream commit: 4a906e49f103c2e544148a209ba1db316510799f
only need to set assigned_dev_id for deassignment, use
match->flags to judge and deassign it.
Acked-by: Mark McLoughlin <[email protected]>
Signed-off-by: Weidong Han <[email protected]>
Signed-off-by: Avi Kivity <[email protected]>
Signed-off-by: Chris Wright <[email protected]>
---
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);