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: 14034550 X-Patchwork-Delegate: kw@linux.com Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 E7B461EF388; Tue, 1 Apr 2025 09:17:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743499059; cv=none; b=VqBWRMCbOOywNixXS2zAbflq8pYeUtiQKWijfYCaeeA0+uqEAAElU1L6aJBPWnIx1Zo6rxyrFaUOqytuC8xn1nbwGJuLKIp7pW2b0PSWtdLCIg/0N+PmrmdS4HbG9+E9QTilIhv5Ml/wMKxgKS6rKPFuPUUqFwkUIzTvx2eHn98= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743499059; c=relaxed/simple; bh=Z64Y0a83D7907bZmI8Ufapa7X360ffiucFi1o4nkTKE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=dQP6TekSNpnQOz06OFBBLrhvAtmgeBarEwpjCgH5HjQBA4jgSeLfxuKGIoZCobg4M5+mhkYYE19ZwXemfM+GrmNQ9iWVMoTfQvLMnZrDoCW+2UavvLXi49N0Sd4c7MMLsX/DB/82+mtkl1irRwec4bsfcshtxypKe9b8PbQbUzc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OSd5a0Fq; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OSd5a0Fq" 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> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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);