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 C1BA7C3DA4A for ; Tue, 20 Aug 2024 09:56:54 +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=h/uEmvXfPmH50nMqLUINY/9aUNqSkaW2y6LtSN770YA=; b=rjlMcLNTAYxVAeHUNpRZ9iwgep hjBESLI97vnZ5Dh4ILJ+5dO5XsygLhXasEAzVuuawQIo6UXGD1uP7MvdWCtoBQK5lSpPI2oopFDlI 8qw2KT/uIRq9Dqug7rbrOUK3Fmx0uwRtPgUdp3dOIc7wq6UwwQ8bVTxwQiLDN5bo54qj12uW3Ejyp 9Fqgg94kYbWqlStjZriSe9+keLSLgim5TqbqjW0OpdwELVPUO+0Wmsonbqf1FGMx9J/J5d8or5ERN h3w3QDV+u+AAU9+K/VLz9SICAOTNBG/0eloT9PF3HN1BzD6U6wxtSRv410h+f9WzfrQN5USDUx6aV mjsmUypw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgLbW-00000004ge5-2z1x; Tue, 20 Aug 2024 09:56:42 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgLZv-00000004gDY-2wAM for linux-arm-kernel@lists.infradead.org; Tue, 20 Aug 2024 09:55:05 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 63F75CE068C; Tue, 20 Aug 2024 09:55:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB4ADC4AF09; Tue, 20 Aug 2024 09:54:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1724147699; bh=Skj0x3MfuIw+zzNHiN5rJLqdPBEqOODIJoUTO80lc48=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ARVc1Xeg15K+Agq6v9d38vDMQ7O8JbcVXDS2KQ0dQ6D9NJAPcR7oAt/g4cO8ic7cj 5NIT4Z5uRtmJlCal0u8FcRQoJcEkO0QcGlc/Q6s8NaVVZfrr54ZC98FO48s6Xeh75i +KVIl98GRb2hukyulOnqPBEwvL1c0SQMvJS0Y9W6K9dOFCrGDnqMWCX2QdLR7Uj+jb yGnjRKX1RBaT2Cj8XAV81713X81zSiSSShL1p3PKu7+SLZwW9fw2Q3tBEF8r2Ep1ah aSqsLKFB7Vzvf0yAvBjIQ3k0w/kM975YleP/yJP5fYxcFjRA4FgLnuhXmOeZVxcnvT Lv2X9tjyaqkgw== 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.95) (envelope-from ) id 1sgLZp-005DZl-13; Tue, 20 Aug 2024 10:54:57 +0100 Date: Tue, 20 Aug 2024 10:54:56 +0100 Message-ID: <86ttffy0wf.wl-maz@kernel.org> From: Marc Zyngier To: Ma Ke Cc: tglx@linutronix.de, Suravee.Suthikulpanit@amd.com, akpm@linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v3] irqchip/gic-v2m: Fix refcount leak in gicv2m_of_init In-Reply-To: <20240820092843.1219933-1-make24@iscas.ac.cn> References: <20240820092843.1219933-1-make24@iscas.ac.cn> 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/29.4 (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: make24@iscas.ac.cn, tglx@linutronix.de, Suravee.Suthikulpanit@amd.com, akpm@linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, stable@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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240820_025503_934706_C5B5A982 X-CRM114-Status: GOOD ( 12.62 ) 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 Tue, 20 Aug 2024 10:28:43 +0100, Ma Ke wrote: > > We fail to perform an of_node_put() when of_address_to_resource() > fails, leading to a refcount leak. > > Address this by moving the error handling path outside of the loop and > making it common to all failure modes. > > Cc: stable@vger.kernel.org > Fixes: 4266ab1a8ff5 ("irqchip/gic-v2m: Refactor to prepare for ACPI support") > Signed-off-by: Ma Ke Reviewed-by: Marc Zyngier M. -- Without deviation from the norm, progress is not possible.