From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752121AbdBFXFu (ORCPT ); Mon, 6 Feb 2017 18:05:50 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:41795 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751456AbdBFXFs (ORCPT ); Mon, 6 Feb 2017 18:05:48 -0500 Subject: Re: [PATCH] powerpc/pseries: Fix missing of_node_put To: Christophe JAILLET , benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au, nfont@linux.vnet.ibm.com, jallen@linux.vnet.ibm.com References: <20170206213616.3661-1-christophe.jaillet@wanadoo.fr> Cc: kernel-janitors@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org From: Tyrel Datwyler Date: Mon, 6 Feb 2017 15:05:42 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <20170206213616.3661-1-christophe.jaillet@wanadoo.fr> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17020623-0016-0000-0000-00000615F9C9 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006569; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000202; SDB=6.00818185; UDB=6.00399795; IPR=6.00595645; BA=6.00005119; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00014204; XFM=3.00000011; UTC=2017-02-06 23:05:47 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17020623-0017-0000-0000-00003729802A Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-02-06_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702060220 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/06/2017 01:36 PM, Christophe JAILLET wrote: > If 'dlpar_configure_connector()' fails, 'parent_dn' should be released as > already done in the normal case. > > Signed-off-by: Christophe JAILLET > --- > arch/powerpc/platforms/pseries/mobility.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c > index 5a0c7ba429ce..b8060c182ae2 100644 > --- a/arch/powerpc/platforms/pseries/mobility.c > +++ b/arch/powerpc/platforms/pseries/mobility.c > @@ -226,13 +226,16 @@ static int add_dt_node(__be32 parent_phandle, __be32 drc_index) > return -ENOENT; > > dn = dlpar_configure_connector(drc_index, parent_dn); Simpler approach would be to move the of_node_put() call to here directly after the last use of parent_dn. -Tyrel > - if (!dn) > - return -ENOENT; > + if (!dn) { > + rc = -ENOENT; > + goto out; > + } > > rc = dlpar_attach_node(dn); > if (rc) > dlpar_free_cc_nodes(dn); > > +out: > of_node_put(parent_dn); > return rc; > } >