From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24D94C432C0 for ; Mon, 25 Nov 2019 20:30:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DD5D420727 for ; Mon, 25 Nov 2019 20:30:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="dLz3w0Xu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DD5D420727 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=prodrive-technologies.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=7JEcbpIQyxT9lyuqS9Y7G/YVOduanqX5fdr6eLg2Dj0=; b=dLz3w0XuQtByIz yueotjxle/U5bUw/3FgHH0CbSqFWgqxKBPcR0WIYyE4OyrPpubDwWF3gGzmXmxrBCnOI0/L7AO4wY a05R0BTeleYnn0FH9mDSDCJxI6jFFEevVCfHGz7TVpSLRuLp/DESgGsHmcMAJanRSnZmVjaQ5d2/e /2/YFbkNnNW+pW9wo3g9dxCK5QWqMAhZB+mfJcGNOUhnr3AeFosS1XlcgycoFu++p3W6SIirsBeHj gCJdVWJSb2aeVgdV8WPfUaUw2uDDDcFWB/FixqpMVzMT914YWx1bSBofDYdTKaRDTa2wc+ldpv6Pm PZp95LTVoOjVIDINeHRg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iZKzz-0003gl-Dq; Mon, 25 Nov 2019 20:30:19 +0000 Received: from mail.prodrive-technologies.com ([212.61.153.67]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iZKzv-0003gD-Tt for linux-arm-kernel@lists.infradead.org; Mon, 25 Nov 2019 20:30:17 +0000 Received: from mail.prodrive-technologies.com (localhost.localdomain [127.0.0.1]) by localhost (Email Security Appliance) with SMTP id 3808632EC5_DDC39D3B; Mon, 25 Nov 2019 20:30:11 +0000 (GMT) Received: from mail.prodrive-technologies.com (exc03.bk.prodrive.nl [10.1.1.212]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.prodrive-technologies.com", Issuer "Prodrive Technologies B.V. OV SSL Issuing CA" (verified OK)) by mail.prodrive-technologies.com (Sophos Email Appliance) with ESMTPS id 2B2E730563_DDC39D2F; Mon, 25 Nov 2019 20:30:10 +0000 (GMT) Received: from lnxclnt2222.Prodrive.nl (10.13.62.32) by EXC03.bk.prodrive.nl (10.1.1.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1779.2; Mon, 25 Nov 2019 21:30:09 +0100 From: Roy van Doormaal To: Brendan Higgins , Benjamin Herrenschmidt , Joel Stanley , Thomas Gleixner , Jason Cooper , Marc Zyngier , Andrew Jeffery , , , , , Subject: [PATCH] irqchip/aspeed-i2c-ic: Fix irq domain name memory leak Date: Mon, 25 Nov 2019 21:29:37 +0100 Message-ID: <20191125202937.23133-1-roy.van.doormaal@prodrive-technologies.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-ClientProxiedBy: EXC03.bk.prodrive.nl (10.1.1.212) To EXC03.bk.prodrive.nl (10.1.1.212) X-SASI-RCODE: 200 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191125_123016_105713_73D41941 X-CRM114-Status: UNSURE ( 7.41 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Roy van Doormaal Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org The aspeed irqchip driver overwrites the default irq domain name, but doesn't free the existing domain name. This patch frees the irq domain name before overwriting it. kmemleak trace: unreferenced object 0xb8004c40 (size 64): comm "swapper", pid 0, jiffies 4294937303 (age 747.660s) hex dump (first 32 bytes): 3a 61 68 62 3a 61 70 62 3a 62 75 73 40 31 65 37 :ahb:apb:bus@1e7 38 61 30 30 30 3a 69 6e 74 65 72 72 75 70 74 2d 8a000:interrupt- backtrace: [<086b59b8>] kmemleak_alloc+0xa8/0xc0 [] __kmalloc_track_caller+0x118/0x1a0 [] kvasprintf+0x5c/0xc0 [<49275eec>] kasprintf+0x30/0x50 [<5713064b>] __irq_domain_add+0x184/0x25c [<53c594d0>] aspeed_i2c_ic_of_init+0x9c/0x128 [] of_irq_init+0x1ec/0x314 [] irqchip_init+0x1c/0x24 [<7ef974b3>] init_IRQ+0x30/0x90 [<87a1438f>] start_kernel+0x28c/0x458 [< (null)>] (null) [] 0xffffffff Signed-off-by: Roy van Doormaal --- drivers/irqchip/irq-aspeed-i2c-ic.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/irqchip/irq-aspeed-i2c-ic.c b/drivers/irqchip/irq-aspeed-i2c-ic.c index 8d591c179f81..8081b8483a79 100644 --- a/drivers/irqchip/irq-aspeed-i2c-ic.c +++ b/drivers/irqchip/irq-aspeed-i2c-ic.c @@ -92,6 +92,8 @@ static int __init aspeed_i2c_ic_of_init(struct device_node *node, goto err_iounmap; } + if (i2c_ic->irq_domain->flags & IRQ_DOMAIN_NAME_ALLOCATED) + kfree(i2c_ic->irq_domain->name); i2c_ic->irq_domain->name = "aspeed-i2c-domain"; irq_set_chained_handler_and_data(i2c_ic->parent_irq, -- 2.20.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel