xen: fix error handling path if xen_allocate_irq_dynamic fails
authorWei Liu <wei.liu2@citrix.com>
Thu, 31 Jan 2013 14:46:56 +0000 (14:46 +0000)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Wed, 6 Feb 2013 15:32:45 +0000 (10:32 -0500)
It is possible that the call to xen_allocate_irq_dynamic() returns negative
number other than -1.

Reviewed-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/xen/events.c

index 0be4df39e953a5b870948e6ed8a1553a15cc2c2a..74d77dfa5f636001356b2d27d370708b820c885e 100644 (file)
@@ -840,7 +840,7 @@ int bind_evtchn_to_irq(unsigned int evtchn)
 
        if (irq == -1) {
                irq = xen_allocate_irq_dynamic();
-               if (irq == -1)
+               if (irq < 0)
                        goto out;
 
                irq_set_chip_and_handler_name(irq, &xen_dynamic_chip,
@@ -944,7 +944,7 @@ int bind_virq_to_irq(unsigned int virq, unsigned int cpu)
 
        if (irq == -1) {
                irq = xen_allocate_irq_dynamic();
-               if (irq == -1)
+               if (irq < 0)
                        goto out;
 
                irq_set_chip_and_handler_name(irq, &xen_percpu_chip,