From patchwork Fri Jan 10 20:49:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 23114 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f69.google.com (mail-qe0-f69.google.com [209.85.128.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1488120A64 for ; Fri, 10 Jan 2014 20:49:53 +0000 (UTC) Received: by mail-qe0-f69.google.com with SMTP id 1sf8669117qec.0 for ; Fri, 10 Jan 2014 12:49:53 -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:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=OvNKYyA6XQArg9i+Q7sOu2CvSH3WVevG6gl8YYerNu0=; b=Kk8aCcR4VPNg5YVWb77gPX4BkrHgYVstHGVfogBfVo24lh7HKQ0f2fXdOnMC2E4fEl O+XR/pTSscvWpl5bMtPEUBhOsMD5NXAXCz6zicaPv2vAnfMPDkqfiCYFb2KYxOuHBsbb kAyPuTtN0Nd/8OS30PH5WQh6PzprLZyK8SqOhP+X1CYrXRkZZnC/kvnflPn7fE7G4PPM D9m5EzG3VlgVmt0mmV3XAsXiJFgjYwLIXOWp2e42iCv72NgzHNy3xRE5TGqD+dyY6KfC Q51czhDdwPLyG3fHYVS+eui+8Kmz8SQN/8jS+IFu0JbZKXI06kO7oqaBS/34QhcD0EZZ nuSQ== X-Gm-Message-State: ALoCoQkt5sTiImiJgEDzhShOX7fs++zf3JtguBu+lbUWi6T530AWbzKfNcO30T43AwloWL1d2sDk X-Received: by 10.236.132.231 with SMTP id o67mr3828368yhi.15.1389386993020; Fri, 10 Jan 2014 12:49:53 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.83.2 with SMTP id m2ls1687099qey.37.gmail; Fri, 10 Jan 2014 12:49:52 -0800 (PST) X-Received: by 10.58.205.170 with SMTP id lh10mr9525561vec.18.1389386992947; Fri, 10 Jan 2014 12:49:52 -0800 (PST) Received: from mail-vb0-f46.google.com (mail-vb0-f46.google.com [209.85.212.46]) by mx.google.com with ESMTPS id sz9si5593151vdc.71.2014.01.10.12.49.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 10 Jan 2014 12:49:52 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.46 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.46; Received: by mail-vb0-f46.google.com with SMTP id w20so3466561vbb.5 for ; Fri, 10 Jan 2014 12:49:52 -0800 (PST) X-Received: by 10.58.22.233 with SMTP id h9mr1951182vef.56.1389386992862; Fri, 10 Jan 2014 12:49:52 -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.59.13.131 with SMTP id ey3csp116482ved; Fri, 10 Jan 2014 12:49:52 -0800 (PST) X-Received: by 10.14.122.5 with SMTP id s5mr11903759eeh.28.1389386991852; Fri, 10 Jan 2014 12:49:51 -0800 (PST) Received: from mail-ee0-f42.google.com (mail-ee0-f42.google.com [74.125.83.42]) by mx.google.com with ESMTPS id p46si12120492eem.231.2014.01.10.12.49.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 10 Jan 2014 12:49:51 -0800 (PST) Received-SPF: neutral (google.com: 74.125.83.42 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=74.125.83.42; Received: by mail-ee0-f42.google.com with SMTP id e49so410036eek.1 for ; Fri, 10 Jan 2014 12:49:51 -0800 (PST) X-Received: by 10.14.175.131 with SMTP id z3mr11922176eel.65.1389386991433; Fri, 10 Jan 2014 12:49:51 -0800 (PST) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id n1sm17492387eep.20.2014.01.10.12.49.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Jan 2014 12:49:50 -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] xen/arm: setup_dt_irq: don't enable the IRQ if the creation has failed Date: Fri, 10 Jan 2014 20:49:47 +0000 Message-Id: <1389386987-26201-1-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 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.212.46 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 --- 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 e6257a7..62510e3 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -605,8 +605,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; }