aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen/events.c
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-09-29 13:26:45 -0400
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-10-19 17:03:28 -0400
commite6599225db36bbdc991d1cc8fbfcacb24f86cdb5 (patch)
treeaf43d45cf1fef289e01af0d317ba82569bd5c91c /drivers/xen/events.c
parent9bb9efe4bab8a877cdde5c6bfbfa202645517571 (diff)
xen/irq: If we fail during msi_capability_init return proper error code.
There are three different modes: PV, HVM, and initial domain 0. In all the cases we would return -1 for failure instead of a proper error code. Fix this by propagating the error code from the generic IRQ code. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/xen/events.c')
-rw-r--r--drivers/xen/events.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 503614f2c122..212a5c871bf4 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -432,7 +432,8 @@ static int __must_check xen_allocate_irq_dynamic(void)
432 432
433 irq = irq_alloc_desc_from(first, -1); 433 irq = irq_alloc_desc_from(first, -1);
434 434
435 xen_irq_init(irq); 435 if (irq >= 0)
436 xen_irq_init(irq);
436 437
437 return irq; 438 return irq;
438} 439}
@@ -713,7 +714,7 @@ int xen_bind_pirq_msi_to_irq(struct pci_dev *dev, struct msi_desc *msidesc,
713 mutex_lock(&irq_mapping_update_lock); 714 mutex_lock(&irq_mapping_update_lock);
714 715
715 irq = xen_allocate_irq_dynamic(); 716 irq = xen_allocate_irq_dynamic();
716 if (irq == -1) 717 if (irq < 0)
717 goto out; 718 goto out;
718 719
719 irq_set_chip_and_handler_name(irq, &xen_pirq_chip, handle_edge_irq, 720 irq_set_chip_and_handler_name(irq, &xen_pirq_chip, handle_edge_irq,
@@ -729,7 +730,7 @@ out:
729error_irq: 730error_irq:
730 mutex_unlock(&irq_mapping_update_lock); 731 mutex_unlock(&irq_mapping_update_lock);
731 xen_free_irq(irq); 732 xen_free_irq(irq);
732 return -1; 733 return ret;
733} 734}
734#endif 735#endif
735 736