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]
Date:   Wed, 8 Dec 2021 14:00:03 +0100
From:   Nicolas Ferre <nicolas.ferre@...rochip.com>
To:     Wan Jiabing <wanjiabing@...o.com>,
        Alexandre Belloni <alexandre.belloni@...tlin.com>,
        Ludovic Desroches <ludovic.desroches@...rochip.com>
CC:     <kael_w@...h.net>, Russell King <linux@...linux.org.uk>,
        <linux-kernel@...r.kernel.org>,
        <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH] ARM: at91: pm: Add of_node_put() before goto

On 14/10/2021 at 10:45, Wan Jiabing wrote:
> Fix following coccicheck warning:
> ./arch/arm/mach-at91/pm.c:643:1-33: WARNING: Function
> for_each_matching_node_and_match should have of_node_put() before goto
> 
> Early exits from for_each_matching_node_and_match should decrement the
> node reference counter.
> 
> Signed-off-by: Wan Jiabing <wanjiabing@...o.com>

Even if I think it doesn't happen after a new SoC DT is in place 
properly, I'm fine with this:
Acked-by: Nicolas Ferre <nicolas.ferre@...rochip.com>

Thanks, best regards,
   Nicolas

> ---
>   arch/arm/mach-at91/pm.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
> index 8711d6824c1f..dd6f4ce3f766 100644
> --- a/arch/arm/mach-at91/pm.c
> +++ b/arch/arm/mach-at91/pm.c
> @@ -645,6 +645,7 @@ static __init int at91_dt_ramc(bool phy_mandatory)
>                  if (!soc_pm.data.ramc[idx]) {
>                          pr_err("unable to map ramc[%d] cpu registers\n", idx);
>                          ret = -ENOMEM;
> +                       of_node_put(np);
>                          goto unmap_ramc;
>                  }
> 
> @@ -670,6 +671,7 @@ static __init int at91_dt_ramc(bool phy_mandatory)
>                  if (!soc_pm.data.ramc_phy) {
>                          pr_err("unable to map ramc phy cpu registers\n");
>                          ret = -ENOMEM;
> +                       of_node_put(np);
>                          goto unmap_ramc;
>                  }
>          }
> --
> 2.20.1
> 


-- 
Nicolas Ferre

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ