[PATCH v2 1/1] bus: arm-cci: add missing of_node_put after calling of_parse_phandle
Peter Chen
peter.chen at nxp.com
Mon Jul 4 02:27:01 PDT 2016
of_node_put needs to be called when the device node which is got
from of_parse_phandle has finished using.
Cc: arm at kernel.org
Cc: Will Deacon <will.deacon at arm.com>
Signed-off-by: Peter Chen <peter.chen at nxp.com>
Reviewed-by: Suzuki K Poulose <suzuki.poulose at arm.com>
---
Changes for v2:
- Address suzuki's comments that calling of_node_put one time
for both error and corrent code path.
drivers/bus/arm-cci.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c
index a49b283..648d130 100644
--- a/drivers/bus/arm-cci.c
+++ b/drivers/bus/arm-cci.c
@@ -1913,9 +1913,10 @@ static int __cci_ace_get_port(struct device_node *dn, int type)
for (i = 0; i < nb_cci_ports; i++) {
ace_match = ports[i].type == type;
if (ace_match && cci_portn == ports[i].dn)
- return i;
+ break;
}
- return -ENODEV;
+ of_node_put(cci_portn);
+ return (i < nb_cci_ports) ? i : -ENODEV;
}
int cci_ace_get_port(struct device_node *dn)
--
1.9.1
More information about the linux-arm-kernel
mailing list