From patchwork Tue Apr 1 09:17:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 14034613 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 42C72C36014 for ; Tue, 1 Apr 2025 09:48:13 +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-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=oolWSUJB12MXy0HU4hw0P6RAj0lm6HbnC+djekF7i1M=; b=J/gwKdmEFKhu67UHQzbfqwf/YZ Iaq3psW+HvwuGWBSnsnrkNdOJjuO+Q0YcJo7bKWMQ2CB9WvGXfERC90D9ndr1HRMtZgDbZ7KaWrL+ 634MvDpw4e3UusNArScOLTLAn6LHjKoiOFpc4D9EDc4coYtaPmPiEdS7T8yAO86g73sCb1IK5n6DU sgjZwnUZxWQit2ruE/1pIM+dutN2ZlGqL85R13oGsPQHF5nskBVuJ5iIOeljKjRkhNfcwgD924M3I jA68PL4Jsh67PJiMp2/zJ70Q59iu/I/qSNCqUlMKbJPBXJj41fdTJMuejxM4y1LU0QC2wkpQHKhOE fU8ET8ng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.1 #2 (Red Hat Linux)) id 1tzYDz-00000002WSs-1nPM; Tue, 01 Apr 2025 09:48:03 +0000 Received: from sea.source.kernel.org ([172.234.252.31]) by bombadil.infradead.org with esmtps (Exim 4.98.1 #2 (Red Hat Linux)) id 1tzXka-00000002RfC-11DD for linux-arm-kernel@lists.infradead.org; Tue, 01 Apr 2025 09:17:42 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 62B3B44DFF; Tue, 1 Apr 2025 09:17:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 874B4C4AF0B; Tue, 1 Apr 2025 09:17:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1743499058; bh=Z64Y0a83D7907bZmI8Ufapa7X360ffiucFi1o4nkTKE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OSd5a0Fq5MgQYBOgxKyA2BP6lFZ3L3o2X8YUHqChWS1c0YVro5vuxoa6s1erFqCXj LtDj//iirnna2suu99++Fom5ybJ2NQVGuBG3jKErZaFW/5JUC7OG37+gdPzA9P1vOX Lg6MjclX69KvZ5xk1oQulCEyQeMUqn6pIPhsFsFf6N+kWwnWNvb2etpsveIxKSPKyz 9yJt+YaYoiWGS3UZOZIXuXY3WeXgpV6SyPmZFZbSTM8Rh41aCPOY6TUJO9p8lAuFpd T8HtTP2cpK2+DyX6oj65Ul9Kv0/bnMcmfCq05A5tBnP3QcnZYwIOT9RjWptboLDGLx 2imhrTsw1IMNQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=valley-girl.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tzXkW-001GqU-Kq; Tue, 01 Apr 2025 10:17:36 +0100 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, asahi@lists.linux.dev Cc: Alyssa Rosenzweig , Janne Grunau , Hector Martin , Sven Peter , Bjorn Helgaas , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Manivannan Sadhasivam , Rob Herring , Krzysztof Kozlowski , Mark Kettenis Subject: [PATCH v3 08/13] PCI: apple: Fix missing OF node reference in apple_pcie_setup_port Date: Tue, 1 Apr 2025 10:17:08 +0100 Message-Id: <20250401091713.2765724-9-maz@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20250401091713.2765724-1-maz@kernel.org> References: <20250401091713.2765724-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, asahi@lists.linux.dev, alyssa@rosenzweig.io, j@jannau.net, marcan@marcan.st, sven@svenpeter.dev, bhelgaas@google.com, lpieralisi@kernel.org, kw@linux.com, manivannan.sadhasivam@linaro.org, robh@kernel.org, krzk+dt@kernel.org, mark.kettenis@xs4all.nl 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-20250401_021740_314992_EE4D2A47 X-CRM114-Status: GOOD ( 11.55 ) 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 From: Hector Martin In the success path, we hang onto a reference to the node, so make sure to grab one. The caller iterator puts our borrowed reference when we return. Reviewed-by: Rob Herring (Arm) Acked-by: Alyssa Rosenzweig Tested-by: Janne Grunau Signed-off-by: Hector Martin Signed-off-by: Alyssa Rosenzweig Signed-off-by: Marc Zyngier --- drivers/pci/controller/pcie-apple.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/pci/controller/pcie-apple.c b/drivers/pci/controller/pcie-apple.c index 6b04bf0b41dcc..23d9f62bd2ad4 100644 --- a/drivers/pci/controller/pcie-apple.c +++ b/drivers/pci/controller/pcie-apple.c @@ -593,6 +593,9 @@ static int apple_pcie_setup_port(struct apple_pcie *pcie, list_add_tail(&port->entry, &pcie->ports); init_completion(&pcie->event); + /* In the success path, we keep a reference to np around */ + of_node_get(np); + ret = apple_pcie_port_register_irqs(port); WARN_ON(ret);