[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181226173717.7113-1-pakki001@umn.edu>
Date: Wed, 26 Dec 2018 11:37:17 -0600
From: Aditya Pakki <pakki001@....edu>
To: pakki001@....edu
Cc: kjlu@....edu, Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
Heiner Kallweit <hkallweit1@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Michal Simek <michal.simek@...inx.com>, netdev@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [PATCH] net:phy: Add a return value check on bus write
xgmiitorgmii_read_status() could fail when writing to the bus via
mdiobus_write(). The fix adds a check and returns an error in case
of failure.
Signed-off-by: Aditya Pakki <pakki001@....edu>
---
drivers/net/phy/xilinx_gmii2rgmii.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/phy/xilinx_gmii2rgmii.c b/drivers/net/phy/xilinx_gmii2rgmii.c
index 74a8782313cf..926879d43373 100644
--- a/drivers/net/phy/xilinx_gmii2rgmii.c
+++ b/drivers/net/phy/xilinx_gmii2rgmii.c
@@ -58,7 +58,9 @@ static int xgmiitorgmii_read_status(struct phy_device *phydev)
else
val |= BMCR_SPEED10;
- mdiobus_write(bus, addr, XILINX_GMII2RGMII_REG, val);
+ err = mdiobus_write(bus, addr, XILINX_GMII2RGMII_REG, val);
+ if (err)
+ return err;
return 0;
}
--
2.17.1
Powered by blists - more mailing lists