Skip to content

Commit cc0de7f

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>
1 parent ec3a73d commit cc0de7f

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
@@ -628,6 +628,9 @@ static int apple_pcie_setup_port(struct apple_pcie *pcie,
628628
list_add_tail(&port->entry, &pcie->ports);
629629
init_completion(&pcie->event);
630630

631+
/* In the success path, we keep a reference to np around */
632+
of_node_get(np);
633+
631634
ret = apple_pcie_port_register_irqs(port);
632635
WARN_ON(ret);
633636

0 commit comments

Comments
 (0)