PCI: apple: Add of_node_put() before return
PATCH 1/1 PCI: apple: Add of_node_put() before return
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 <[email protected]>
--- drivers/pci/controller/pcie-apple.c | 1 + 1 file changed, 1 insertion(+)
drivers/pci/controller/pcie-apple.c +1 -0
@@ -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; } }
Signature · 1 line
2.20.1
Quoted 11 lines · Wan Jiabing
Fix following coccicheck warning:
./drivers/pci/controller/pcie-apple.c:771:1-23: WARNING: Functionfor_each_child_of_nodeshould haveof_node_put()before returnEarly exits from
for_each_child_of_nodeshould decrement the node reference counter.Signed-off-by Wan Jiabing <[email protected]>--- drivers/pci/controller/pcie-apple.c | 1 + 1 file changed, 1 insertion(+)
Squashed in the commit it is fixing, updated my pci/apple branch.
Thanks,
Lorenzo
Quoted 16 lines
drivers/pci/controller/pcie-apple.c +1
-0@@ -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; } }Signature · 1 line
2.20.1