Skip to content

Commit 97e10a1

Browse files
marcanjannau
authored andcommitted
PCI: apple: Fix missing OF node reference in apple_pcie_setup_port
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>
1 parent f505696 commit 97e10a1

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/pci/controller/pcie-apple.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,9 @@ static int apple_pcie_setup_port(struct apple_pcie *pcie,
593593
list_add_tail(&port->entry, &pcie->ports);
594594
init_completion(&pcie->event);
595595

596+
/* In the success path, we keep a reference to np around */
597+
of_node_get(np);
598+
596599
ret = apple_pcie_port_register_irqs(port);
597600
WARN_ON(ret);
598601

0 commit comments

Comments
 (0)