From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Chen Subject: [PATCH 4/7] bus: arm-cci: add missing of_node_put after calling of_parse_phandle Date: Fri, 1 Jul 2016 17:41:58 +0800 Message-ID: <1467366121-14120-5-git-send-email-peter.chen@nxp.com> References: <1467366121-14120-1-git-send-email-peter.chen@nxp.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1467366121-14120-1-git-send-email-peter.chen@nxp.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Peter Chen , Will Deacon , Suzuki K Poulose List-Id: linux-pm@vger.kernel.org of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using. Cc: Will Deacon Cc: Suzuki K Poulose Signed-off-by: Peter Chen --- 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