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] [day] [month] [year] [list]
Message-ID: <DB3PR0402MB3916D1A18B80F35B9F86563CF51A0@DB3PR0402MB3916.eurprd04.prod.outlook.com>
Date:   Thu, 13 Feb 2020 08:41:17 +0000
From:   Anson Huang <anson.huang@....com>
To:     Uwe Kleine-König 
        <u.kleine-koenig@...gutronix.de>
CC:     "linux@...linux.org.uk" <linux@...linux.org.uk>,
        "shawnguo@...nel.org" <shawnguo@...nel.org>,
        "s.hauer@...gutronix.de" <s.hauer@...gutronix.de>,
        "kernel@...gutronix.de" <kernel@...gutronix.de>,
        "festevam@...il.com" <festevam@...il.com>,
        "allison@...utok.net" <allison@...utok.net>,
        "tglx@...utronix.de" <tglx@...utronix.de>,
        "andrew.smirnov@...il.com" <andrew.smirnov@...il.com>,
        "kstewart@...uxfoundation.org" <kstewart@...uxfoundation.org>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        "rfontana@...hat.com" <rfontana@...hat.com>,
        "sakari.ailus@...ux.intel.com" <sakari.ailus@...ux.intel.com>,
        "bhelgaas@...gle.com" <bhelgaas@...gle.com>,
        "dsterba@...e.com" <dsterba@...e.com>, Peng Fan <peng.fan@....com>,
        "okuno.kohji@...panasonic.com" <okuno.kohji@...panasonic.com>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        dl-linux-imx <linux-imx@....com>
Subject: RE: [PATCH V2] ARM: imx: Add missing of_node_put()

Hi, Uwe

> Subject: Re: [PATCH V2] ARM: imx: Add missing of_node_put()
> 
> On Thu, Feb 13, 2020 at 02:20:54PM +0800, Anson Huang wrote:
> > After finishing using device node got from of_find_compatible_node(),
> > of_node_put() needs to be called.
> >
> > Signed-off-by: Anson Huang <Anson.Huang@....com>
> > ---
> > Changes since V1:
> > 	- correct some of_node_put() place to make sure it is safe to be put.
> > ---
> >  arch/arm/mach-imx/anatop.c     | 3 +++
> >  arch/arm/mach-imx/gpc.c        | 1 +
> >  arch/arm/mach-imx/platsmp.c    | 1 +
> >  arch/arm/mach-imx/pm-imx6.c    | 2 ++
> >  arch/arm/mach-imx/pm-imx7ulp.c | 1 +
> >  5 files changed, 8 insertions(+)
> >
> > diff --git a/arch/arm/mach-imx/anatop.c b/arch/arm/mach-imx/anatop.c
> > index 8fb68c0..5985731 100644
> > --- a/arch/arm/mach-imx/anatop.c
> > +++ b/arch/arm/mach-imx/anatop.c
> > @@ -135,6 +135,7 @@ void __init imx_init_revision_from_anatop(void)
> >  			void __iomem *src_base;
> >  			u32 sbmr2;
> >
> > +			of_node_put(np);
> >  			np = of_find_compatible_node(NULL, NULL,
> >  						     "fsl,imx6ul-src");
> >  			src_base = of_iomap(np, 0);
> > @@ -152,6 +153,8 @@ void __init imx_init_revision_from_anatop(void)
> >
> >  	mxc_set_cpu_type(digprog >> 16 & 0xff);
> >  	imx_set_soc_revision(revision);
> > +
> > +	of_node_put(np);
> >  }
> 
> It would be a bit more natural here IMHO to introduce a second struct
> device_node * variable for the fsl,imx6ul-src device. Then each of_node_put
> would belong to exactly one of_find_compatible_node().
> (Now the of_node_put() in line 157 frees the fsl,imx6ul-src on i.MX6ULL and
> fsl,imx6q-anatop on the others.)

Make sense, please help review V3.
Thanks,
Anson

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ