From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-by2nam01on0102.outbound.protection.outlook.com ([104.47.34.102]:24891 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729080AbeIQIbo (ORCPT ); Mon, 17 Sep 2018 04:31:44 -0400 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Brandon Maier , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL 4.9 39/57] net: phy: xgmiitorgmii: Check read_status results Date: Mon, 17 Sep 2018 03:04:07 +0000 Message-ID: <20180917030340.378-39-alexander.levin@microsoft.com> References: <20180917030340.378-1-alexander.levin@microsoft.com> In-Reply-To: <20180917030340.378-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Brandon Maier [ Upstream commit 8d0752d11312be830c33e84dfd1016e6a47c2938 ] We're ignoring the result of the attached phy device's read_status(). Return it so we can detect errors. Signed-off-by: Brandon Maier Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/phy/xilinx_gmii2rgmii.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/xilinx_gmii2rgmii.c b/drivers/net/phy/xilinx_g= mii2rgmii.c index 2e5150b0b8d5..449b31319010 100644 --- a/drivers/net/phy/xilinx_gmii2rgmii.c +++ b/drivers/net/phy/xilinx_gmii2rgmii.c @@ -40,8 +40,11 @@ static int xgmiitorgmii_read_status(struct phy_device *p= hydev) { struct gmii2rgmii *priv =3D phydev->priv; u16 val =3D 0; + int err; =20 - priv->phy_drv->read_status(phydev); + err =3D priv->phy_drv->read_status(phydev); + if (err < 0) + return err; =20 val =3D mdiobus_read(phydev->mdio.bus, priv->addr, XILINX_GMII2RGMII_REG)= ; val &=3D ~XILINX_GMII2RGMII_SPEED_MASK; --=20 2.17.1