Linux PCI subsystem development
 help / color / mirror / Atom feed
* [PATCH] PCI: apple: Add of_node_put() before return
@ 2021-10-15  8:09 Wan Jiabing
  2021-10-18 11:08 ` Lorenzo Pieralisi
  0 siblings, 1 reply; 2+ messages in thread
From: Wan Jiabing @ 2021-10-15  8:09 UTC (permalink / raw)
  To: Alyssa Rosenzweig, Marc Zyngier, Lorenzo Pieralisi, Rob Herring,
	Krzysztof Wilczyński, Bjorn Helgaas, linux-pci, linux-kernel
  Cc: kael_w, Wan Jiabing

Fix following coccicheck warning:
./drivers/pci/controller/pcie-apple.c:771:1-23: WARNING: Function
for_each_child_of_node should have of_node_put() before return

Early exits from for_each_child_of_node should decrement the
node reference counter.

Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
---
 drivers/pci/controller/pcie-apple.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pci/controller/pcie-apple.c b/drivers/pci/controller/pcie-apple.c
index b4db7a065553..13101389e988 100644
--- a/drivers/pci/controller/pcie-apple.c
+++ b/drivers/pci/controller/pcie-apple.c
@@ -772,6 +772,7 @@ static int apple_pcie_init(struct pci_config_window *cfg)
 		ret = apple_pcie_setup_port(pcie, of_port);
 		if (ret) {
 			dev_err(pcie->dev, "Port %pOF setup fail: %d\n", of_port, ret);
+			of_node_put(of_port);
 			return ret;
 		}
 	}
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-18 11:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-15  8:09 [PATCH] PCI: apple: Add of_node_put() before return Wan Jiabing
2021-10-18 11:08 ` Lorenzo Pieralisi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox