From patchwork Wed Jun 24 06:32:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiezhu Yang X-Patchwork-Id: 11622335 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1945013B1 for ; Wed, 24 Jun 2020 06:33:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0BA5320B80 for ; Wed, 24 Jun 2020 06:33:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389165AbgFXGdW (ORCPT ); Wed, 24 Jun 2020 02:33:22 -0400 Received: from mail.loongson.cn ([114.242.206.163]:45256 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2389144AbgFXGdU (ORCPT ); Wed, 24 Jun 2020 02:33:20 -0400 Received: from linux.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9Dxj9+j8_Je2R5JAA--.564S16; Wed, 24 Jun 2020 14:33:15 +0800 (CST) From: Tiezhu Yang To: Thomas Gleixner , Jason Cooper , Marc Zyngier Cc: linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, Xuefeng Li Subject: [PATCH v2 14/14] irqchip/xilinx-intc: Fix potential resource leak Date: Wed, 24 Jun 2020 14:32:47 +0800 Message-Id: <1592980367-1816-15-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1592980367-1816-1-git-send-email-yangtiezhu@loongson.cn> References: <1592980367-1816-1-git-send-email-yangtiezhu@loongson.cn> X-CM-TRANSID: AQAAf9Dxj9+j8_Je2R5JAA--.564S16 X-Coremail-Antispam: 1UD129KBjvdXoW7GF4rWFyxtr4fGF1fWrWUCFg_yoWDGrX_Cr 1aqws3GrW0vr17G3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el.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org There exists potential resource leak in the error path, fix it. Fixes: 9689c99e4950 ("irqchip/xilinx: Add support for parent intc") Signed-off-by: Tiezhu Yang --- drivers/irqchip/irq-xilinx-intc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-xilinx-intc.c b/drivers/irqchip/irq-xilinx-intc.c index 1d3d273..dcc51e0 100644 --- a/drivers/irqchip/irq-xilinx-intc.c +++ b/drivers/irqchip/irq-xilinx-intc.c @@ -241,7 +241,7 @@ static int __init xilinx_intc_of_init(struct device_node *intc, } else { pr_err("irq-xilinx: interrupts property not in DT\n"); ret = -EINVAL; - goto error; + goto error_domain_remove; } } else { primary_intc = irqc; @@ -250,6 +250,8 @@ static int __init xilinx_intc_of_init(struct device_node *intc, return 0; +error_domain_remove: + irq_domain_remove(irqc->root_domain); error: iounmap(irqc->base); kfree(irqc);