[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230710105835.4e4pv7nxbatx7ygq@skbuf>
Date: Mon, 10 Jul 2023 13:58:35 +0300
From: Vladimir Oltean <vladimir.oltean@....com>
To: Lu Hongfei <luhongfei@...o.com>
Cc: Claudiu Manoil <claudiu.manoil@....com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
UNGLinuxDriver@...rochip.com, Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
opensource.kernel@...o.com
Subject: Re: [PATCH] net: dsa: Removed unneeded of_node_put in
felix_parse_ports_node
On Mon, Jul 10, 2023 at 11:18:59AM +0800, Lu Hongfei wrote:
> Remove unnecessary of_node_put from the continue path to prevent
> child node from being released twice, which could avoid resource
> leak or other unexpected issues.
>
> Signed-off-by: Lu Hongfei <luhongfei@...o.com>
> ---
> drivers/net/dsa/ocelot/felix.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c
> index dee43caee19e..8da46d284e35 100644
> --- a/drivers/net/dsa/ocelot/felix.c
> +++ b/drivers/net/dsa/ocelot/felix.c
> @@ -1286,7 +1286,6 @@ static int felix_parse_ports_node(struct felix *felix,
> if (err < 0) {
> dev_info(dev, "Unsupported PHY mode %s on port %d\n",
> phy_modes(phy_mode), port);
> - of_node_put(child);
>
> /* Leave port_phy_modes[port] = 0, which is also
> * PHY_INTERFACE_MODE_NA. This will perform a
> --
> 2.39.0
>
Fixes: de879a016a94 ("net: dsa: felix: add functionality when not all ports are supported")
Reviewed-by: Vladimir Oltean <vladimir.oltean@....com>
Powered by blists - more mailing lists