Thread (18 messages) flat view 18 messages, 7 authors, 2016-07-11
STALE3686d

[PATCH 4/7] bus: arm-cci: add missing of_node_put after calling of_parse_phandle

From: Peter Chen <hidden>
Date: 2016-07-01 10:25:14
Also in: linux-pm, linux-renesas-soc, linux-samsung-soc, lkml
Subsystem: the rest · Maintainer: Linus Torvalds

of_node_put needs to be called when the device node which is got
from of_parse_phandle has finished using.

Cc: Will Deacon <redacted>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Peter Chen <redacted>
---
 drivers/bus/arm-cci.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c
index a49b283..e7b0b8c 100644
--- a/drivers/bus/arm-cci.c
+++ b/drivers/bus/arm-cci.c
@@ -1912,9 +1912,12 @@ static int __cci_ace_get_port(struct device_node *dn, int type)
 	cci_portn = of_parse_phandle(dn, "cci-control-port", 0);
 	for (i = 0; i < nb_cci_ports; i++) {
 		ace_match = ports[i].type == type;
-		if (ace_match && cci_portn == ports[i].dn)
+		if (ace_match && cci_portn == ports[i].dn) {
+			of_node_put(cci_portn);
 			return i;
+		}
 	}
+	of_node_put(cci_portn);
 	return -ENODEV;
 }
 
-- 
1.9.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help