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: <e10a7764-7a81-b3b9-aecd-6b5a947f1e19@wdc.com>
Date:   Tue, 22 Nov 2022 07:45:18 +0000
From:   Damien Le Moal <Damien.LeMoal@....com>
To:     Peng Zhang <zhangpeng362@...wei.com>,
        "linus.walleij@...aro.org" <linus.walleij@...aro.org>,
        "seanga2@...il.com" <seanga2@...il.com>,
        "palmerdabbelt@...gle.com" <palmerdabbelt@...gle.com>
CC:     "linux-riscv@...ts.infradead.org" <linux-riscv@...ts.infradead.org>,
        "linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "sunnanyong@...wei.com" <sunnanyong@...wei.com>,
        "wangkefeng.wang@...wei.com" <wangkefeng.wang@...wei.com>
Subject: Re: [PATCH] pinctrl: call of_node_put() when breaking out of
 for_each_available_child_of_node()

On 2022/11/22 16:33, Peng Zhang wrote:
> From: ZhangPeng <zhangpeng362@...wei.com>
> 
> Since for_each_available_child_of_node() will increase the refcount of
> node, we need to call of_node_put() manually when breaking out of the
> iteration.
> 
> Fixes: d4c34d09ab03 ("pinctrl: Add RISC-V Canaan Kendryte K210 FPIOA driver")
> Signed-off-by: ZhangPeng <zhangpeng362@...wei.com>
> ---
>  drivers/pinctrl/pinctrl-k210.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-k210.c b/drivers/pinctrl/pinctrl-k210.c
> index ecab6bf63dc6..ad4db99094a7 100644
> --- a/drivers/pinctrl/pinctrl-k210.c
> +++ b/drivers/pinctrl/pinctrl-k210.c
> @@ -862,8 +862,10 @@ static int k210_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
>  	for_each_available_child_of_node(np_config, np) {
>  		ret = k210_pinctrl_dt_subnode_to_map(pctldev, np, map,
>  						     &reserved_maps, num_maps);
> -		if (ret < 0)
> +		if (ret < 0) {
> +			of_node_put(np);
>  			goto err;
> +		}
>  	}
>  	return 0;
>  

Reviewed-by: Damien Le Moal <damien.lemoal@...nsource.wdc.com>

-- 
Damien Le Moal
Western Digital Research

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ