aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjing zhang <zj.barak@gmail.com>2010-03-13 02:00:45 -0500
committerAvi Kivity <avi@redhat.com>2010-05-17 05:15:36 -0400
commitd57e2c0740bbdd768dcbafe58cf62174f31d7c2d (patch)
tree50ac4407800ec7660f070539d2ac89854280d6ae
parenta87fa35514bcf17aeca97245574e3f735cec9074 (diff)
KVM: fix assigned_device_enable_host_msix error handling
Free IRQ's and disable MSIX upon failure. Cc: Avi Kivity <avi@redhat.com> Signed-off-by: Jing Zhang <zj.barak@gmail.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
-rw-r--r--virt/kvm/assigned-dev.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/virt/kvm/assigned-dev.c b/virt/kvm/assigned-dev.c
index 02ff2b19dbe2..4d10b1e047f4 100644
--- a/virt/kvm/assigned-dev.c
+++ b/virt/kvm/assigned-dev.c
@@ -316,12 +316,16 @@ static int assigned_device_enable_host_msix(struct kvm *kvm,
316 kvm_assigned_dev_intr, 0, 316 kvm_assigned_dev_intr, 0,
317 "kvm_assigned_msix_device", 317 "kvm_assigned_msix_device",
318 (void *)dev); 318 (void *)dev);
319 /* FIXME: free requested_irq's on failure */
320 if (r) 319 if (r)
321 return r; 320 goto err;
322 } 321 }
323 322
324 return 0; 323 return 0;
324err:
325 for (i -= 1; i >= 0; i--)
326 free_irq(dev->host_msix_entries[i].vector, (void *)dev);
327 pci_disable_msix(dev->dev);
328 return r;
325} 329}
326 330
327#endif 331#endif