aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/pci/xen.c10
-rw-r--r--drivers/xen/events.c7
2 files changed, 11 insertions, 6 deletions
diff --git a/arch/x86/pci/xen.c b/arch/x86/pci/xen.c
index 1017c7bee388..11a9301d52d4 100644
--- a/arch/x86/pci/xen.c
+++ b/arch/x86/pci/xen.c
@@ -175,8 +175,10 @@ static int xen_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
175 "pcifront-msi-x" : 175 "pcifront-msi-x" :
176 "pcifront-msi", 176 "pcifront-msi",
177 DOMID_SELF); 177 DOMID_SELF);
178 if (irq < 0) 178 if (irq < 0) {
179 ret = irq;
179 goto free; 180 goto free;
181 }
180 i++; 182 i++;
181 } 183 }
182 kfree(v); 184 kfree(v);
@@ -221,8 +223,10 @@ static int xen_hvm_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
221 if (msg.data != XEN_PIRQ_MSI_DATA || 223 if (msg.data != XEN_PIRQ_MSI_DATA ||
222 xen_irq_from_pirq(pirq) < 0) { 224 xen_irq_from_pirq(pirq) < 0) {
223 pirq = xen_allocate_pirq_msi(dev, msidesc); 225 pirq = xen_allocate_pirq_msi(dev, msidesc);
224 if (pirq < 0) 226 if (pirq < 0) {
227 irq = -ENODEV;
225 goto error; 228 goto error;
229 }
226 xen_msi_compose_msg(dev, pirq, &msg); 230 xen_msi_compose_msg(dev, pirq, &msg);
227 __write_msi_msg(msidesc, &msg); 231 __write_msi_msg(msidesc, &msg);
228 dev_dbg(&dev->dev, "xen: msi bound to pirq=%d\n", pirq); 232 dev_dbg(&dev->dev, "xen: msi bound to pirq=%d\n", pirq);
@@ -244,7 +248,7 @@ static int xen_hvm_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
244error: 248error:
245 dev_err(&dev->dev, 249 dev_err(&dev->dev,
246 "Xen PCI frontend has not registered MSI/MSI-X support!\n"); 250 "Xen PCI frontend has not registered MSI/MSI-X support!\n");
247 return -ENODEV; 251 return irq;
248} 252}
249 253
250#ifdef CONFIG_XEN_DOM0 254#ifdef CONFIG_XEN_DOM0
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