[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] xen/events: fix error codes in xen_bind_pirq_msi_to_irq()



The error code needs to be set on these error paths.

Fixes: 5dd9ad32d775 ("xen/events: drop xen_allocate_irqs_dynamic()")
Fixes: d2ba3166f23b ("xen/events: move drivers/xen/events.c into 
drivers/xen/events/")
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
---
Are we going to backport these to stable?  Should I split this into two
patches?

 drivers/xen/events/events_base.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
index f5edb9e27e3c..aae62603b461 100644
--- a/drivers/xen/events/events_base.c
+++ b/drivers/xen/events/events_base.c
@@ -1105,13 +1105,17 @@ int xen_bind_pirq_msi_to_irq(struct pci_dev *dev, 
struct msi_desc *msidesc,
        mutex_lock(&irq_mapping_update_lock);
 
        irq = irq_alloc_descs(-1, 0, nvec, -1);
-       if (irq < 0)
+       if (irq < 0) {
+               ret = irq;
                goto out;
+       }
 
        for (i = 0; i < nvec; i++) {
                info = xen_irq_init(irq + i);
-               if (!info)
+               if (!info) {
+                       ret = -ENOMEM;
                        goto error_irq;
+               }
 
                irq_set_chip_and_handler_name(irq + i, &xen_pirq_chip, 
handle_edge_irq, name);
 
-- 
2.42.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.