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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 1B618C43458 for ; Fri, 26 Jun 2026 13:41:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bX0S3zR4J7UosSNB+8lNASqBfRpYSXTZ2FsLGUUqcC8=; b=Wfs5sCpgLzWkUFJmoK7k3DVMgf tK3sL6fGPrC+vXFSymIpsCa+tsSvZqyeC5t7ODjQVWiZ5L3jJkmgQmsHTYy+0NOqp+8gcmwRv2s8k chayCYT0yAGX7T7wepRyqEJVHYMLq1IIn4d15aDBVPKlpaIQMbCkI/WXjy9WJMS1vuxm654BFrhF8 Sjmja0pBwJOdTsIADSI1pLzp5jfgYp4xnHI5U81zNMU4RrSW3hr3/azN8bQOiyiiNb9We6UlifXLV 3Rj5qYIk56wo1t/qHBlymKhSJ5Yl56Dt40Fbeou6WMY+Wj5PHU2gPV0s1v2tE9+hxEAw8pvXZNTUW iEgSZ3Cw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wd6o8-0000000BPey-47wa; Fri, 26 Jun 2026 13:41:25 +0000 Received: from sea.source.kernel.org ([172.234.252.31]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wd6o7-0000000BPeZ-2fH3 for linux-arm-kernel@lists.infradead.org; Fri, 26 Jun 2026 13:41:23 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 66014412BE; Fri, 26 Jun 2026 13:41:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 492501F000E9; Fri, 26 Jun 2026 13:41:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1782481283; bh=bX0S3zR4J7UosSNB+8lNASqBfRpYSXTZ2FsLGUUqcC8=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=YUr4PSf+U7g8Fh3zNdf+H7G6YmTW9zkHcUTaSXw9sIP80B86ZBZ4mgJ3Ejs85friH TC9JCq37sHr4gNIc+U+dZW8jMOdKM8ttff23ulHU5chyGLXCnrvrKT8r3sZ4f6sxb6 1EGVa8705WEfcpChTlFGj17ggSEmJYLBJA/M8v+mPG/BhW3jSLl99zE8d+ms3rkeAo 5iQo8T/B6/GuF/1++2vy3UsjzBNNAPK8tptm16MBcg/A5Wmh0af5MFmRUjQ1qzyq6n CC4ncnDYpIkXz+DVAfZymZVabslVimoNhXsFGnUKX7Py52E78bX4kIql0mIKYIPIRo ZfmGv77JB0Wig== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wd6o5-0000000GM3k-2Coh; Fri, 26 Jun 2026 13:41:21 +0000 Date: Fri, 26 Jun 2026 14:41:21 +0100 Message-ID: <867bnlqv0e.wl-maz@kernel.org> From: Marc Zyngier To: Yuho Choi Cc: Thomas Gleixner , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] irqchip/gic-v3-its: Fix OF node reference leak In-Reply-To: <20260626033747.1515585-1-dbgh9129@gmail.com> References: <20260626033747.1515585-1-dbgh9129@gmail.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: dbgh9129@gmail.com, tglx@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, 26 Jun 2026 04:37:47 +0100, Yuho Choi wrote: > > of_get_cpu_node() returns a referenced device node. In > its_cpu_init_collection(), the Cavium 23144 workaround only uses the > node to compare the CPU NUMA node, but the reference is never dropped. > > Use the device_node cleanup helper for the CPU node reference so it is > released when leaving the workaround block, including the NUMA mismatch > return path. > > Fixes: fbf8f40e1658 ("irqchip/gicv3-its: numa: Enable workaround for Cavium thunderx erratum 23144") > Signed-off-by: Yuho Choi > --- > - Use __free(device_node) for the CPU node reference. > - Correct the Fixes tag to fbf8f40e1658. > > drivers/irqchip/irq-gic-v3-its.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c > index b57d81ad33a0..63942cf1dbe3 100644 > --- a/drivers/irqchip/irq-gic-v3-its.c > +++ b/drivers/irqchip/irq-gic-v3-its.c > @@ -3290,9 +3290,9 @@ static void its_cpu_init_collection(struct its_node *its) > > /* avoid cross node collections and its mapping */ > if (its->flags & ITS_FLAGS_WORKAROUND_CAVIUM_23144) { > - struct device_node *cpu_node; > + struct device_node *cpu_node __free(device_node) = > + of_get_cpu_node(cpu, NULL); Please keep this on a single line. I find nothing more irritating than these split assignments. > > - cpu_node = of_get_cpu_node(cpu, NULL); > if (its->numa_node != NUMA_NO_NODE && > its->numa_node != of_node_to_nid(cpu_node)) > return; Worth taking this opportunity to fix the indentation here. With these two nits addressed: Acked-by: Marc Zyngier M. -- Without deviation from the norm, progress is not possible.