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  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:   Mon, 15 Apr 2019 11:52:20 +0200
From:   Ulf Hansson <ulf.hansson@...aro.org>
To:     Nicholas Mc Guire <hofrat@...dl.org>
Cc:     Russell King <linux@...linux.org.uk>,
        Shawn Guo <shawnguo@...nel.org>,
        Sascha Hauer <s.hauer@...gutronix.de>,
        Pengutronix Kernel Team <kernel@...gutronix.de>,
        Fabio Estevam <festevam@...il.com>,
        NXP Linux Team <linux-imx@....com>,
        Mark Brown <broonie@...nel.org>,
        Linus Walleij <linus.walleij@...aro.org>,
        Tony Lindgren <tony@...mide.com>,
        Mike Rapoport <rppt@...ux.vnet.ibm.com>,
        Janusz Krzysztofik <jmkrzyszt@...il.com>,
        Linux ARM <linux-arm-kernel@...ts.infradead.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ARM: ux500: add missing of_node_put()

On Sat, 13 Apr 2019 at 09:20, Nicholas Mc Guire <hofrat@...dl.org> wrote:
>
>  of_find_compatible_node() returns a pointer with refcount incremented
> so both in the error path as well as after usage in soc_info_populate()
> respectively actually b8500_read_soc_id() an explicit of_node_put is
> needed to release backupram.
>
> Signed-off-by: Nicholas Mc Guire <hofrat@...dl.org>
> Fixes: commit 18a992787896 ("ARM: ux500: move soc_id driver to drivers/soc")

Acked-by: Ulf Hansson <ulf.hansson@...aro.org>

> ---
>
> Problem located with experimental cocinelle script
>
> get_maintainer.pl only returns linux-kernel@...r.kernel.org for
> this file ? Is MAINTAINERS entry missing ?

drivers/soc/ux500 should be added to the ARM/NOMADIK/U300/Ux500
ARCHITECTURES section, which is maintained by Linus Walleij.

If you send a patch, I am sure Linus will ack it.

>
> Not really sure about the referenced fixes commit 18a992787896
> ("ARM: ux500: move soc_id driver to drivers/soc") the commit log notes
> only that the driver is being moved and not expected to change (v4.8)
> but looking at the previous version in v4.7 it does seem that while
> moving the driver there was also a relevant change to the driver code
> including the switch to using of_find_compatible_node().
>
> Patch was compiletested with: u8500_defconfig (implies
> ONFIG_UX500_SOC_ID=y)
>
> Patch is against 4.18-rc3 (localversion-next is next-20180706)
>
>  drivers/soc/ux500/ux500-soc-id.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/soc/ux500/ux500-soc-id.c b/drivers/soc/ux500/ux500-soc-id.c
> index 6c1be74..e22597d 100644
> --- a/drivers/soc/ux500/ux500-soc-id.c
> +++ b/drivers/soc/ux500/ux500-soc-id.c
> @@ -203,10 +203,13 @@ static int __init ux500_soc_device_init(void)
>         ux500_setup_id();
>
>         soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);
> -       if (!soc_dev_attr)
> +       if (!soc_dev_attr) {
> +               of_node_put(backupram);
>                 return -ENOMEM;
> +       }
>
>         soc_info_populate(soc_dev_attr, backupram);
> +       of_node_put(backupram);
>
>         soc_dev = soc_device_register(soc_dev_attr);
>         if (IS_ERR(soc_dev)) {
> --
> 2.1.4
>

Powered by blists - more mailing lists