From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752828AbcGAKeB (ORCPT ); Fri, 1 Jul 2016 06:34:01 -0400 Received: from foss.arm.com ([217.140.101.70]:38080 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752585AbcGAKd7 (ORCPT ); Fri, 1 Jul 2016 06:33:59 -0400 Date: Fri, 1 Jul 2016 11:33:47 +0100 From: Will Deacon To: Suzuki K Poulose Cc: Peter Chen , 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, Sudeep Holla Subject: Re: [PATCH 4/7] bus: arm-cci: add missing of_node_put after calling of_parse_phandle Message-ID: <20160701103346.GF12735@arm.com> References: <1467366121-14120-1-git-send-email-peter.chen@nxp.com> <1467366121-14120-5-git-send-email-peter.chen@nxp.com> <57764626.4060800@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <57764626.4060800@arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 01, 2016 at 11:29:58AM +0100, Suzuki K Poulose wrote: > On 01/07/16 10:41, Peter Chen wrote: > >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 > > Thanks for the fix. > > >--- > > 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); > > nit: Could we please do some thing like this ? > if (ace_match && cci_portn == ports[i].dn) > break; > } > > of_node_put(cci_portn); > return (i < nb_cci_ports) ? i : -ENODEV ; > > Either way, > > Reviewed-by: Suzuki K Poulose Please route this via arm-soc once you've addressed Suzuki's comment. Will