Skip to content

Commit 68ba45f

Browse files
Wei Liukonradwilk
authored andcommitted
xen: fix error handling path if xen_allocate_irq_dynamic fails
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>
1 parent 51ac889 commit 68ba45f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/xen/events.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ int bind_evtchn_to_irq(unsigned int evtchn)
840840

841841
if (irq == -1) {
842842
irq = xen_allocate_irq_dynamic();
843-
if (irq == -1)
843+
if (irq < 0)
844844
goto out;
845845

846846
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)
944944

945945
if (irq == -1) {
946946
irq = xen_allocate_irq_dynamic();
947-
if (irq == -1)
947+
if (irq < 0)
948948
goto out;
949949

950950
irq_set_chip_and_handler_name(irq, &xen_percpu_chip,

0 commit comments

Comments
 (0)