From patchwork Fri Jan 24 16:43:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 23681 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f72.google.com (mail-pa0-f72.google.com [209.85.220.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5917B203C5 for ; Fri, 24 Jan 2014 16:43:51 +0000 (UTC) Received: by mail-pa0-f72.google.com with SMTP id rd3sf8161093pab.11 for ; Fri, 24 Jan 2014 08:43:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=RJKrQ79F9jtybYF5o92xt9w2VktARRoorYEHJ1kI+jc=; b=LkgebzWiUtHtmGHHieoCX1C88A/XctA99Wv+tX0qDdNaPC5Mh9IT12fK3768avlyfJ TYgNlcDDF/yv2rRsYvLyhuGkLaftsZ1ZGG+qRFKn5u0pKmn/GZd4lcbEHLOW4RyvHA04 EjqLbcxYRyUPUaC0TSTEZNs9ctim4PGU2KDvzAcdwsfLXB00weZU38nRIzoBL3Q6aOad VT3x9yzs+x62wZkLcSo1mz4W7DR/IMCLs18n1DYJ+F0rlw0M8t30f0V03XjdScVQvevc CWMKjlXZvt64kjtQcsGlZlMIzTMbB15BcPsHPkByujZTPtYm0ZjH0pWk+nZcBRrg6Zvm euQQ== X-Gm-Message-State: ALoCoQlvCKbHRYvql0DwJ5qX4rzhBdpTmcLE0DWzLgqo0dk1pZuzE5qijqRh63QLN+uDgK/yVLrd X-Received: by 10.66.137.8 with SMTP id qe8mr3277219pab.46.1390581830572; Fri, 24 Jan 2014 08:43:50 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.81.16 with SMTP id e16ls659649qgd.63.gmail; Fri, 24 Jan 2014 08:43:50 -0800 (PST) X-Received: by 10.58.66.137 with SMTP id f9mr8042959vet.11.1390581830383; Fri, 24 Jan 2014 08:43:50 -0800 (PST) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx.google.com with ESMTPS id k10si800976vca.124.2014.01.24.08.43.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 24 Jan 2014 08:43:50 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.181; Received: by mail-ve0-f181.google.com with SMTP id cz12so2067897veb.40 for ; Fri, 24 Jan 2014 08:43:50 -0800 (PST) X-Received: by 10.221.36.8 with SMTP id sy8mr75171vcb.71.1390581830311; Fri, 24 Jan 2014 08:43:50 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp115778vcz; Fri, 24 Jan 2014 08:43:49 -0800 (PST) X-Received: by 10.14.32.67 with SMTP id n43mr13565646eea.17.1390581829450; Fri, 24 Jan 2014 08:43:49 -0800 (PST) Received: from mail-ea0-f171.google.com (mail-ea0-f171.google.com [209.85.215.171]) by mx.google.com with ESMTPS id 3si3229388eeq.59.2014.01.24.08.43.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 24 Jan 2014 08:43:49 -0800 (PST) Received-SPF: neutral (google.com: 209.85.215.171 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=209.85.215.171; Received: by mail-ea0-f171.google.com with SMTP id f15so531585eak.16 for ; Fri, 24 Jan 2014 08:43:48 -0800 (PST) X-Received: by 10.14.37.131 with SMTP id y3mr13326727eea.1.1390581828951; Fri, 24 Jan 2014 08:43:48 -0800 (PST) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id k41sm5521285eey.0.2014.01.24.08.43.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jan 2014 08:43:48 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Cc: patches@linaro.org, ian.campbell@citrix.com, tim@xen.org, stefano.stabellini@citrix.com, 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> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1390581822-32624-1-git-send-email-julien.grall@linaro.org> References: <1390581822-32624-1-git-send-email-julien.grall@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 Acked-by: Ian Campbell --- 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; }