From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6285D3F8231 for ; Fri, 26 Jun 2026 13:41:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782481284; cv=none; b=UkWqQThOd7InH51VzhNckSYraxAjXB6/MIUtWXvI8SmmV7FGuebfhDT9slE/5W/Xu5Ek/7gWa2PQBzqLiKgXFyCdirw/5gD2ESByZorgWnRDaNvSfJ02cvBrT1tgUEJ+LcpERKyRwWirXmdzNCwcunOCnY8C25kEqsmZ+ErsNNg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782481284; c=relaxed/simple; bh=jcP9z5S6SI0E9c+KSotsi9Ycp9ORflgW0vfh4vHqrvY=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=qXFXF0FoJaXFdFZgWPxx3rxhSITlDX50sJEwEx9m50YuOhcdUugK00EjOY5TlE/Ortk70i4qKI7h3yIdtQ6U/gF8OFLwG00kzMlngNLGa4rbV4RkS6HiImeYAE7FPZpcjGn8L47F4wwOrPbxrlJ7fbFcHaxIEaIdrFsNOdLSo8I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YUr4PSf+; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YUr4PSf+" 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) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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.