Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp226380ybt; Tue, 30 Jun 2020 19:18:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKt14Wg06J6VpAWrKfHgxhbFj3iFmqT9LVTWoHpXzkXwN0xqjcSMV7tuAyOcrGVAFeZs0P X-Received: by 2002:a50:f385:: with SMTP id g5mr25457455edm.347.1593569896291; Tue, 30 Jun 2020 19:18:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593569896; cv=none; d=google.com; s=arc-20160816; b=sffSoLZO1zRVc2XDLLayXMslO4gwz1e2YgTHZh/vs7t77UesrVZoxzdDe04vb8ziSi WcBNhegcVoomWZ9prAxQECY86zZL/Ru3kgwIrBTAGj8WC1O0nh3P2lbGaMpmZjhlzpme 0yGGBbcub76sMB5+1lpJBWtxfRKM16flqHL7o+pgQ8Y6T+hLpT+1akXCO/0Q0+9tK0+h +BtEjRYofhzCgPMtewgWOiVq2wS2Mw9ALPFmT03zaCsh6aJip+NDqcbXiIUf8TkqhuNP KGHX/230qM+rX3/1xcD7p05/PKOg4l5BMIowDePLsmUQc8GJ17a0G7+5J948zV/yysDE taSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=mjFtcWXmIzEei5FIWIdqm2AGFdVtKkpzUrfDaKd/JYw=; b=0DuK4ntava1qZCTO3Jfiy0rnRe9LCX3sGt5S4eS10OnzbIIZxunyXhmDcVXbyvs6/O 4PWRAOHUocouxxOL6E3BIjnvplXPWegqCuLyRnkaJ310OidQec4MJv8f3JiEh4PvF6Pr /xweRjokLn/jsMjSgxTVOn0UxSfDc+b4r3MGapByghffaSyWedOA/hkJ9WrAKYhXlpZq pnVP3xHf9sys+6B5lFKhPv+ps0r95sgrg9xIklJgQgFAGRmI1KIv15QDefc2v+0lcGZ3 wWQ23/y+lK/ORvn0P9KLNNdZr6y8v5gfcaBqOnzPT1mfUp7K4h6mr5/8wlULoJcTCQzo 1YOQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id zh8si2806984ejb.305.2020.06.30.19.17.53; Tue, 30 Jun 2020 19:18:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726885AbgGACQv (ORCPT + 99 others); Tue, 30 Jun 2020 22:16:51 -0400 Received: from mail.loongson.cn ([114.242.206.163]:47696 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726750AbgGACQh (ORCPT ); Tue, 30 Jun 2020 22:16:37 -0400 Received: from linux.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9Dxz2r68fteU2dNAA--.5801S10; Wed, 01 Jul 2020 10:16:29 +0800 (CST) From: Tiezhu Yang To: Thomas Gleixner , Jason Cooper , Marc Zyngier Cc: linux-kernel@vger.kernel.org, Markus Elfring Subject: [PATCH v4 08/14] irqchip/ls1x: Fix potential resource leaks Date: Wed, 1 Jul 2020 10:16:20 +0800 Message-Id: <1593569786-11500-9-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1593569786-11500-1-git-send-email-yangtiezhu@loongson.cn> References: <1593569786-11500-1-git-send-email-yangtiezhu@loongson.cn> X-CM-TRANSID: AQAAf9Dxz2r68fteU2dNAA--.5801S10 X-Coremail-Antispam: 1UD129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xU4eMKDUUUU X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In the function ls1x_intc_of_init(), system resource "parent_irq" was not released in a few error cases. Thus add jump target for the completion of the desired exception handling. Fixes: 9e543e22e204 ("irqchip: Add driver for Loongson-1 interrupt controller") Signed-off-by: Tiezhu Yang --- drivers/irqchip/irq-ls1x.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-ls1x.c b/drivers/irqchip/irq-ls1x.c index 353111a..409001b 100644 --- a/drivers/irqchip/irq-ls1x.c +++ b/drivers/irqchip/irq-ls1x.c @@ -131,7 +131,7 @@ static int __init ls1x_intc_of_init(struct device_node *node, if (!priv->domain) { pr_err("ls1x-irq: cannot add IRQ domain\n"); err = -ENOMEM; - goto out_iounmap; + goto out_dispose_irq; } err = irq_alloc_domain_generic_chips(priv->domain, 32, 2, @@ -182,6 +182,8 @@ static int __init ls1x_intc_of_init(struct device_node *node, out_free_domain: irq_domain_remove(priv->domain); +out_dispose_irq: + irq_dispose_mapping(parent_irq); out_iounmap: iounmap(priv->intc_base); out_free_priv: -- 2.1.0