lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 10 Apr 2013 09:06:11 +0000
From:	Tang Yuantian-B29983 <B29983@...escale.com>
To:	Stephen Rothwell <sfr@...b.auug.org.au>
CC:	"grant.likely@...retlab.ca" <grant.likely@...retlab.ca>,
	"devicetree-discuss@...ts.ozlabs.org" 
	<devicetree-discuss@...ts.ozlabs.org>,
	"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"rob.herring@...xeda.com" <rob.herring@...xeda.com>
Subject: RE: [PATCH] of: remove the unnecessary of_node_put for
 of_parse_phandle_with_args()


> -----Original Message-----
> From: Stephen Rothwell [mailto:sfr@...b.auug.org.au]
> Sent: 2013年4月10日 17:03
> To: Tang Yuantian-B29983
> Cc: grant.likely@...retlab.ca; devicetree-discuss@...ts.ozlabs.org;
> linuxppc-dev@...ts.ozlabs.org; linux-kernel@...r.kernel.org;
> rob.herring@...xeda.com
> Subject: Re: [PATCH] of: remove the unnecessary of_node_put for
> of_parse_phandle_with_args()
> 
> Hi,
> 
> On Tue, 9 Apr 2013 14:56:09 +0800 <Yuantian.Tang@...escale.com> wrote:
> >
> > From: Tang Yuantian <yuantian.tang@...escale.com>
> >
> > As the function itself says it is caller's responsibility to call the
> > of_node_put().  So, remove it on success to keep the reference count
> > correct.
> >
> > Signed-off-by: Tang Yuantian <Yuantian.Tang@...escale.com>
> > ---
> >  drivers/of/base.c | 3 ---
> >  1 file changed, 3 deletions(-)
> >
> > diff --git a/drivers/of/base.c b/drivers/of/base.c index
> > 321d3ef..e8b4c28 100644
> > --- a/drivers/of/base.c
> > +++ b/drivers/of/base.c
> > @@ -1168,9 +1168,6 @@ static int __of_parse_phandle_with_args(const
> struct device_node *np,
> >  					out_args->args[i] = be32_to_cpup(list++);
> >  			}
> >
> > -			/* Found it! return success */
> > -			if (node)
> > -				of_node_put(node);
> 
> Actually, if out_args is NULL, you should do the of_node_put(node), so
> probably the correct fix is to add an "else" before the above "if" (and
> move the comment).
> 

Yes, I already sent out the v2 patch.
Please see: http://patchwork.ozlabs.org/patch/235288/

Regards,
Yuantian

> --
> Cheers,
> Stephen Rothwell                    sfr@...b.auug.org.au
> http://www.canb.auug.org.au/~sfr/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ