diff options
author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2011-09-29 13:26:45 -0400 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2011-10-19 17:03:28 -0400 |
commit | e6599225db36bbdc991d1cc8fbfcacb24f86cdb5 (patch) | |
tree | af43d45cf1fef289e01af0d317ba82569bd5c91c /arch/x86/pci/xen.c | |
parent | 9bb9efe4bab8a877cdde5c6bfbfa202645517571 (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 'arch/x86/pci/xen.c')
-rw-r--r-- | arch/x86/pci/xen.c | 10 |
1 files changed, 7 insertions, 3 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) | |||
244 | error: | 248 | error: |
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 |