public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] net:phy: Add a return value check on bus write
@ 2018-12-26 17:37 Aditya Pakki
  2018-12-26 17:44 ` Heiner Kallweit
  2018-12-26 17:50 ` Heiner Kallweit
  0 siblings, 2 replies; 3+ messages in thread
From: Aditya Pakki @ 2018-12-26 17:37 UTC (permalink / raw)
  To: pakki001
  Cc: Andrew Lunn, Florian Fainelli, netdev, kjlu, Michal Simek,
	linux-kernel, David S. Miller, linux-arm-kernel, Heiner Kallweit

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@umn.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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-12-26 17:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-26 17:37 [PATCH] net:phy: Add a return value check on bus write Aditya Pakki
2018-12-26 17:44 ` Heiner Kallweit
2018-12-26 17:50 ` Heiner Kallweit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox