Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp226698ybt; Tue, 30 Jun 2020 19:18:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFmLy/oMnmkx/ZHHwKcHQYnUHjzQ1gNjxzhGV40JlRtATpWfT2Y2XMWje/PmHmAksqhAl8 X-Received: by 2002:a17:906:1a16:: with SMTP id i22mr1745564ejf.439.1593569937742; Tue, 30 Jun 2020 19:18:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593569937; cv=none; d=google.com; s=arc-20160816; b=idh2NLF4y+ABXfbizW2DmFv6+NRq2pWDOozofh7wCR+K1pBLo5Cz2yN0JZtlGtSN+O V0AOHl3jLZRIb9hr6cYmO0J6VhbrNjtFcGUlPgDwqUMevXZgtRVb7Ze7UvVEQHRBDoke K24ZDqgZ9DECJXk5AvXLhT5phXXE9Ug22/fffjlQdLKnK0+048oO72Dw6uSap+g/dGaL UufxdkgaU/PeTFo4PgPuUqyOwO88CmTQJDsIh6BDLWFtoLKRSsGLGuxat9K+9P4P8P1W a6/OcMxcaATI8FHBp0//DPONPowr8jnDj/6zYcWurHm/lZGXQ0MrPXHgrtad3MGpGs4l hfiQ== 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=jl0lUOHCX9n9NvHN+3CO2m8LFOPJk9j9oN6ZHwRrDgE=; b=LSwdnhOAXO2GYlbtvYj1gNXVcpth5Hszk0FkIHXS2Go/SelBok/xhAP3GHlgZvh+Es USaOgVBo8m8+M6v26oDhNdisMXT8uUF4BvaWe46TeNxa+f537sWZbUyr1FRT6wCT23pi RAVKXAYw64TW9Ymqwxz1NdqKV9Qp3zegPZ+Xma/bCOU6gkHZlvh88iOzaPnG8tnCATO7 wTPZoQaiTjMfzOqPupDjkeKBv+otlwjjRkdiWs3U5qWeSRmwWVs8kdDRSoe8h4cX3v1m BHS9AVEVfF4EdtlCfGUV+tRGsMjZOD/V3EK89ifIAYU4e/QjI8uGPxHTdQjLsxCPVZGS rayQ== 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 y17si2756987edw.91.2020.06.30.19.18.35; Tue, 30 Jun 2020 19:18:57 -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 S1727016AbgGACRX (ORCPT + 99 others); Tue, 30 Jun 2020 22:17:23 -0400 Received: from mail.loongson.cn ([114.242.206.163]:47706 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726723AbgGACQg (ORCPT ); Tue, 30 Jun 2020 22:16:36 -0400 Received: from linux.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9Dxz2r68fteU2dNAA--.5801S11; Wed, 01 Jul 2020 10:16:30 +0800 (CST) From: Tiezhu Yang To: Thomas Gleixner , Jason Cooper , Marc Zyngier Cc: linux-kernel@vger.kernel.org, Markus Elfring Subject: [PATCH v4 09/14] irqchip/mscc-ocelot: Fix potential resource leaks Date: Wed, 1 Jul 2020 10:16:21 +0800 Message-Id: <1593569786-11500-10-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--.5801S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UvcSsGvfC2KfnxnUUI43ZEXa7IU8Gii3UUUUU== 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 ocelot_irq_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: 19d99164480a ("irqchip: Add a driver for the Microsemi Ocelot controller") Signed-off-by: Tiezhu Yang --- drivers/irqchip/irq-mscc-ocelot.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-mscc-ocelot.c b/drivers/irqchip/irq-mscc-ocelot.c index 88143c0..e676ae2 100644 --- a/drivers/irqchip/irq-mscc-ocelot.c +++ b/drivers/irqchip/irq-mscc-ocelot.c @@ -73,7 +73,8 @@ static int __init ocelot_irq_init(struct device_node *node, &irq_generic_chip_ops, NULL); if (!domain) { pr_err("%pOFn: unable to add irq domain\n", node); - return -ENOMEM; + ret = -ENOMEM; + goto err_irq_dispose; } ret = irq_alloc_domain_generic_chips(domain, OCELOT_NR_IRQ, 1, @@ -109,9 +110,10 @@ static int __init ocelot_irq_init(struct device_node *node, err_gc_free: irq_free_generic_chip(gc); - err_domain_remove: irq_domain_remove(domain); +err_irq_dispose: + irq_dispose_mapping(parent_irq); return ret; } -- 2.1.0