From: jing zhang Date: Sat, 13 Mar 2010 07:00:45 +0000 (+0800) Subject: KVM: fix assigned_device_enable_host_msix error handling X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d57e2c0740bbdd768dcbafe58cf62174f31d7c2d;p=linux-beck.git KVM: fix assigned_device_enable_host_msix error handling Free IRQ's and disable MSIX upon failure. Cc: Avi Kivity Signed-off-by: Jing Zhang Signed-off-by: Marcelo Tosatti --- 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, kvm_assigned_dev_intr, 0, "kvm_assigned_msix_device", (void *)dev); - /* FIXME: free requested_irq's on failure */ if (r) - return r; + goto err; } return 0; +err: + for (i -= 1; i >= 0; i--) + free_irq(dev->host_msix_entries[i].vector, (void *)dev); + pci_disable_msix(dev->dev); + return r; } #endif