[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <efff779e-96e1-473a-8b9c-114b090ff02c@lunn.ch>
Date: Mon, 22 Sep 2025 14:53:42 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>,
Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Lennert Buytenhek <buytenh@...tstofly.org>,
Andy Fleming <afleming@...escale.com>, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH net v1] net: mv643xx_eth: Fix an error handling path in
mv643xx_eth_probe()
On Mon, Sep 22, 2025 at 10:08:28AM +0200, Christophe JAILLET wrote:
> If an error occurs after calling phy_connect_direct(), phy_disconnect()
> should be called, as already done in the remove function.
>
> Fixes: ed94493fb38a ("mv643xx_eth: convert to phylib")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> ---
> This patch is speculative and compile tested only.
> Review with care.
> ---
> drivers/net/ethernet/marvell/mv643xx_eth.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
> index 0ab52c57c648..de6a683d7afc 100644
> --- a/drivers/net/ethernet/marvell/mv643xx_eth.c
> +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
> @@ -3263,6 +3263,8 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
> return 0;
>
> out:
> + if (dev->phydev)
> + phy_disconnect(dev->phydev);
This is correct, but it is a little bit less obviously correct than it
could be. Nothing in mv643xx_eth_probe sets dev->phydev. It happens
deep down in the call chain of of_phy_connect(). Just using:
if (phydev)
phy_disconnect(phydev);
would be more obvious for this probe function.
But since it is correct, Reviewed-by: Andrew Lunn <andrew@...n.ch>
and i will leave you to decide if you want to change it.
Andrew
Powered by blists - more mailing lists