aboutsummaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/kvm_main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 4f43abe198e4..1838052f3c9e 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -152,6 +152,8 @@ static void kvm_free_assigned_device(struct kvm *kvm,
152 */ 152 */
153 kvm_put_kvm(kvm); 153 kvm_put_kvm(kvm);
154 154
155 pci_reset_function(assigned_dev->dev);
156
155 pci_release_regions(assigned_dev->dev); 157 pci_release_regions(assigned_dev->dev);
156 pci_disable_device(assigned_dev->dev); 158 pci_disable_device(assigned_dev->dev);
157 pci_dev_put(assigned_dev->dev); 159 pci_dev_put(assigned_dev->dev);
@@ -283,6 +285,9 @@ static int kvm_vm_ioctl_assign_device(struct kvm *kvm,
283 __func__); 285 __func__);
284 goto out_disable; 286 goto out_disable;
285 } 287 }
288
289 pci_reset_function(dev);
290
286 match->assigned_dev_id = assigned_dev->assigned_dev_id; 291 match->assigned_dev_id = assigned_dev->assigned_dev_id;
287 match->host_busnr = assigned_dev->busnr; 292 match->host_busnr = assigned_dev->busnr;
288 match->host_devfn = assigned_dev->devfn; 293 match->host_devfn = assigned_dev->devfn;