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]
Message-ID: <86a216db-b9b7-da45-ab74-a32538da6e00@foss.st.com>
Date:   Fri, 23 Apr 2021 14:02:39 +0200
From:   Christophe Kerello <christophe.kerello@...s.st.com>
To:     Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>,
        Nicolas Ferre <nicolas.ferre@...rochip.com>,
        Alexandre Belloni <alexandre.belloni@...tlin.com>,
        Ludovic Desroches <ludovic.desroches@...rochip.com>,
        Maxime Coquelin <mcoquelin.stm32@...il.com>,
        Alexandre Torgue <alexandre.torgue@...s.st.com>,
        Christophe Kerello <christophe.kerello@...com>,
        Miquel Raynal <miquel.raynal@...tlin.com>,
        Boris Brezillon <bbrezillon@...nel.org>,
        <linux-kernel@...r.kernel.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-stm32@...md-mailman.stormreply.com>
Subject: Re: [Linux-stm32] [PATCH 1/2] memory: stm32-fmc2-ebi: add missing
 of_node_put for loop iteration

Hi Krzysztof,

On 4/23/21 12:18 PM, Krzysztof Kozlowski wrote:
> Early exits from for_each_available_child_of_node() should decrement the
> node reference counter.  Reported by Coccinelle:
> 
>    drivers/memory/stm32-fmc2-ebi.c:1046:1-33: WARNING:
>      Function "for_each_available_child_of_node" should have of_node_put() before return around line 1051.
> 
> Fixes: 66b8173a197f ("memory: stm32-fmc2-ebi: add STM32 FMC2 EBI controller driver")
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>
> ---
>   drivers/memory/stm32-fmc2-ebi.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/memory/stm32-fmc2-ebi.c b/drivers/memory/stm32-fmc2-ebi.c
> index 4d5758c419c5..ffec26a99313 100644
> --- a/drivers/memory/stm32-fmc2-ebi.c
> +++ b/drivers/memory/stm32-fmc2-ebi.c
> @@ -1048,16 +1048,19 @@ static int stm32_fmc2_ebi_parse_dt(struct stm32_fmc2_ebi *ebi)
>   		if (ret) {
>   			dev_err(dev, "could not retrieve reg property: %d\n",
>   				ret);
> +			of_node_put(child);
>   			return ret;
>   		}
>   
>   		if (bank >= FMC2_MAX_BANKS) {
>   			dev_err(dev, "invalid reg value: %d\n", bank);
> +			of_node_put(child);
>   			return -EINVAL;
>   		}
>   
>   		if (ebi->bank_assigned & BIT(bank)) {
>   			dev_err(dev, "bank already assigned: %d\n", bank);
> +			of_node_put(child);
>   			return -EINVAL;
>   		}
>   
> @@ -1066,6 +1069,7 @@ static int stm32_fmc2_ebi_parse_dt(struct stm32_fmc2_ebi *ebi)
>   			if (ret) {
>   				dev_err(dev, "setup chip select %d failed: %d\n",
>   					bank, ret);
> +				of_node_put(child);
>   				return ret;
>   			}
>   		}
>

Reviewed-by: Christophe Kerello <christophe.kerello@...s.st.com>

Regards,
Christophe Kerello.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ