[PATCH] kvm: clean up assigned_device_enable_host_msix

jing zhang
2010-03-13T07:00:46Z

From: Jing Zhang <zj.barak@gmail.com>

Date: Sat Mar 13 14:05:27 2010

Cc: Avi Kivity <avi@redhat.com>
Signed-off-by: Jing Zhang <zj.barak@gmail.com>

---

--- a/virt/kvm/assigned-dev.c 2010-03-02 20:10:18.000000000 +0800
+++ b/virt/kvm/assigned-dev.c 2010-03-02 20:26:18.000000000 +0800
@@ -315,12 +315,16 @@ static int assigned_device_enable_host_m
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