[PATCH] pci/controller/pcie-rcar-host: Hold the reference returned by of_find_matching_node

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In rcar_pcie_init(), we need to hold the reference returned by
of_find_matching_node() which is used to call of_node_put() for
refcount balance.

Signed-off-by: Liang He <windhl@xxxxxxx>
---
 drivers/pci/controller/pcie-rcar-host.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/controller/pcie-rcar-host.c b/drivers/pci/controller/pcie-rcar-host.c
index 997c4df6a1e7..405ec3d64f30 100644
--- a/drivers/pci/controller/pcie-rcar-host.c
+++ b/drivers/pci/controller/pcie-rcar-host.c
@@ -1158,7 +1158,10 @@ static const struct of_device_id rcar_pcie_abort_handler_of_match[] __initconst
 
 static int __init rcar_pcie_init(void)
 {
-	if (of_find_matching_node(NULL, rcar_pcie_abort_handler_of_match)) {
+	struct device_node *np = of_find_matching_node(NULL, rcar_pcie_abort_handler_of_match);
+
+	if (np) {
+		of_node_put(np);
 #ifdef CONFIG_ARM_LPAE
 		hook_fault_code(17, rcar_pcie_aarch32_abort_handler, SIGBUS, 0,
 				"asynchronous external abort");
-- 
2.25.1




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux