[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<SG2PR06MB374377F784F3D314DCAF1AA6BD2CA@SG2PR06MB3743.apcprd06.prod.outlook.com>
Date: Thu, 6 Jul 2023 12:34:34 +0000
From: 王明-软件底层技术部 <machel@...o.com>
To: Leon Romanovsky <leon@...nel.org>
CC: Sunil Goutham <sgoutham@...vell.com>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski
<kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, "netdev@...r.kernel.org"
<netdev@...r.kernel.org>, LKML <linux-kernel@...r.kernel.org>,
opensource.kernel <opensource.kernel@...o.com>
Subject:
回复: [PATCH net v2] net:thunderx:Fix resource leaks in device_for_each_child_node() loops
Hi
Sorry, I resubmitted, but forgot about your point. Does this affect patch?
-----邮件原件-----
发件人: Leon Romanovsky <leon@...nel.org>
发送时间: 2023年7月6日 3:10
收件人: 王明-软件底层技术部 <machel@...o.com>
抄送: Sunil Goutham <sgoutham@...vell.com>; David S. Miller <davem@...emloft.net>; Eric Dumazet <edumazet@...gle.com>; Jakub Kicinski <kuba@...nel.org>; Paolo Abeni <pabeni@...hat.com>; linux-arm-kernel@...ts.infradead.org; netdev@...r.kernel.org; linux-kernel@...r.kernel.org; opensource.kernel <opensource.kernel@...o.com>
主题: Re: [PATCH net v2] net:thunderx:Fix resource leaks in device_for_each_child_node() loops
[Some people who received this message don't often get email from leon@...nel.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
On Wed, Jul 05, 2023 at 10:34:56PM +0800, Wang Ming wrote:
> The device_for_each_child_node() loop in
> bgx_init_of_phy() function should have
> wnode_handle_put() before break
> which could avoid resource leaks.
> This patch could fix this bug.
It is very strange typographic. You have ~80 chars per-line, while your longest line is 40 chars only.
>
> Signed-off-by: Wang Ming <machel@...o.com>
> ---
> drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
> b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
> index a317feb8decb..dad32d36a015 100644
> --- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
> +++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
> @@ -1478,8 +1478,10 @@ static int bgx_init_of_phy(struct bgx *bgx)
> * cannot handle it, so exit the loop.
> */
> node = to_of_node(fwn);
> - if (!node)
> + if (!node) {
> + fwnode_handle_put(fwn);
> break;
> + }
>
> of_get_mac_address(node, bgx->lmac[lmac].mac);
>
> @@ -1503,6 +1505,7 @@ static int bgx_init_of_phy(struct bgx *bgx)
> lmac++;
> if (lmac == bgx->max_lmac) {
> of_node_put(node);
> + fwnode_handle_put(fwn);
> break;
> }
> }
> --
> 2.25.1
>
>
Powered by blists - more mailing lists