From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: [PATCH for-4.5 2/8] xen/arm: setup_dt_irq: don't enable the IRQ if the creation has failed Date: Fri, 24 Jan 2014 16:43:36 +0000 Message-ID: <1390581822-32624-3-git-send-email-julien.grall@linaro.org> References: <1390581822-32624-1-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1W6jrC-0001ru-Mi for xen-devel@lists.xenproject.org; Fri, 24 Jan 2014 16:43:50 +0000 Received: by mail-ee0-f42.google.com with SMTP id e49so1079089eek.1 for ; Fri, 24 Jan 2014 08:43:48 -0800 (PST) In-Reply-To: <1390581822-32624-1-git-send-email-julien.grall@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: stefano.stabellini@citrix.com, Julien Grall , tim@xen.org, ian.campbell@citrix.com, patches@linaro.org List-Id: xen-devel@lists.xenproject.org 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 --- xen/arch/arm/gic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c index 1943f92..55e7622 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -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; } -- 1.7.10.4