Skip to content

Commit 3dc6ddf

Browse files
Nicholas Mc Guirebjorn-helgaas
authored andcommitted
PCI: faraday: Add missing of_node_put()
The call to of_get_next_child() returns a node pointer with refcount incremented thus it must be explicitly decremented here in the error path and after the last usage. Fixes: d3c68e0 ("PCI: faraday: Add Faraday Technology FTPCI100 PCI Host Bridge driver") Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> [lorenzo.pieralisi@arm.com: updated commit log] Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 342639d commit 3dc6ddf

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎drivers/pci/controller/pci-ftpci100.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,11 +355,13 @@ static int faraday_pci_setup_cascaded_irq(struct faraday_pci *p)
355355
irq = of_irq_get(intc, 0);
356356
if (irq <= 0) {
357357
dev_err(p->dev, "failed to get parent IRQ\n");
358+
of_node_put(intc);
358359
return irq ?: -EINVAL;
359360
}
360361

361362
p->irqdomain = irq_domain_add_linear(intc, PCI_NUM_INTX,
362363
&faraday_pci_irqdomain_ops, p);
364+
of_node_put(intc);
363365
if (!p->irqdomain) {
364366
dev_err(p->dev, "failed to create Gemini PCI IRQ domain\n");
365367
return -EINVAL;

0 commit comments

Comments
 (0)