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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220629114913.41670052@fixe.home>
Date:   Wed, 29 Jun 2022 11:49:13 +0200
From:   Clément Léger <clement.leger@...tlin.com>
To:     Yang Yingliang <yangyingliang@...wei.com>
Cc:     <linux-kernel@...r.kernel.org>, <netdev@...r.kernel.org>,
        <linux-renesas-soc@...r.kernel.org>, <olteanv@...il.com>,
        <f.fainelli@...il.com>, <davem@...emloft.net>
Subject: Re: [PATCH -next] net: dsa: rzn1-a5psw: add missing of_node_put()
 in a5psw_pcs_get()

Le Wed, 29 Jun 2022 17:24:35 +0800,
Yang Yingliang <yangyingliang@...wei.com> a écrit :

> of_parse_phandle() will increase the refcount of 'pcs_node', so add
> of_node_put() before return from a5psw_pcs_get().
> 
> Fixes: 888cdb892b61 ("net: dsa: rzn1-a5psw: add Renesas RZ/N1 advanced 5 port switch driver")
> Reported-by: Hulk Robot <hulkci@...wei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@...wei.com>
> ---
>  drivers/net/dsa/rzn1_a5psw.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/dsa/rzn1_a5psw.c b/drivers/net/dsa/rzn1_a5psw.c
> index 3e910da98ae2..301171ee1061 100644
> --- a/drivers/net/dsa/rzn1_a5psw.c
> +++ b/drivers/net/dsa/rzn1_a5psw.c
> @@ -923,6 +923,7 @@ static int a5psw_pcs_get(struct a5psw *a5psw)
>  	return 0;
>  
>  free_pcs:
> +	of_node_put(pcs_node);

of_node_put(pcs_node) should probably also be called after
miic_create(a5psw->dev, pcs_node); since it is not needed anymore.

Clément

>  	of_node_put(port);
>  	of_node_put(ports);
>  	a5psw_pcs_free(a5psw);


-- 
Clément Léger,
Embedded Linux and Kernel engineer at Bootlin
https://bootlin.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ