]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
PCI: apple: Fix missing OF node reference in apple_pcie_setup_port
authorHector Martin <marcan@marcan.st>
Tue, 1 Apr 2025 09:17:08 +0000 (10:17 +0100)
committerManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Wed, 23 Apr 2025 07:22:48 +0000 (12:52 +0530)
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.

Signed-off-by: Hector Martin <marcan@marcan.st>
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Tested-by: Janne Grunau <j@jannau.net>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Link: https://patch.msgid.link/20250401091713.2765724-9-maz@kernel.org
drivers/pci/controller/pcie-apple.c

index 152a65db3ff0eda7a180e68d81bc846cd77b5b73..cd02aa93a5c432722d4a73279f1894093b0288a7 100644 (file)
@@ -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);