]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
xen/arm: setup_dt_irq: don't enable the IRQ if the creation has failed
authorJulien Grall <julien.grall@linaro.org>
Fri, 24 Jan 2014 16:43:36 +0000 (16:43 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 12 Mar 2014 13:48:33 +0000 (13:48 +0000)
For now __setup_dt_irq can only fail if the action is already set. If in the
future, the function is updated we don't want to enable the IRQ.

Assuming the function can fail with action = NULL, when Xen will receive the
IRQ it will segfault because do_IRQ doesn't check if action is NULL.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/gic.c

index a607da3370c4de80c6e1ceeb2f8a7dbf21ff828b..d028e30dfa0686d541fb931a365ad2912091ca03 100644 (file)
@@ -608,8 +608,8 @@ int __init setup_dt_irq(const struct dt_irq *irq, struct irqaction *new)
     rc = __setup_irq(desc, irq->irq, new);
     spin_unlock_irqrestore(&desc->lock, flags);
 
-    desc->handler->startup(desc);
-
+    if ( !rc )
+        desc->handler->startup(desc);
 
     return rc;
 }