[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZA8mxgA5Q+CSuDqK@corigine.com>
Date: Mon, 13 Mar 2023 14:36:06 +0100
From: Simon Horman <simon.horman@...igine.com>
To: Heiner Kallweit <hkallweit1@...il.com>
Cc: Paolo Abeni <pabeni@...hat.com>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
David Miller <davem@...emloft.net>,
Russell King - ARM Linux <linux@...linux.org.uk>,
Andrew Lunn <andrew@...n.ch>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Patrick Trantham <patrick.trantham@...l7.com>
Subject: Re: [PATCH net] net: phy: smsc: bail out in lan87xx_read_status if
genphy_read_status fails
On Sat, Mar 11, 2023 at 07:34:45PM +0100, Heiner Kallweit wrote:
> If genphy_read_status fails then further access to the PHY may result
> in unpredictable behavior. To prevent this bail out immediately if
> genphy_read_status fails.
>
> Fixes: 4223dbffed9f ("net: phy: smsc: Re-enable EDPD mode for LAN87xx")
> Signed-off-by: Heiner Kallweit <hkallweit1@...il.com>
Reviewed-by: Simon Horman <simon.horman@...igine.com>
> ---
> drivers/net/phy/smsc.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c
> index 9cfaccce1..721871184 100644
> --- a/drivers/net/phy/smsc.c
> +++ b/drivers/net/phy/smsc.c
> @@ -189,8 +189,11 @@ static int lan95xx_config_aneg_ext(struct phy_device *phydev)
> static int lan87xx_read_status(struct phy_device *phydev)
> {
> struct smsc_phy_priv *priv = phydev->priv;
> + int err;
>
> - int err = genphy_read_status(phydev);
> + err = genphy_read_status(phydev);
> + if (err)
> + return err;
>
> if (!phydev->link && priv->energy_enable && phydev->irq == PHY_POLL) {
> /* Disable EDPD to wake up PHY */
> --
> 2.39.2
Powered by blists - more mailing lists