summaryrefslogtreecommitdiff
path: root/drivers/net/phy/mscc
diff options
context:
space:
mode:
authorAntoine Tenart <antoine.tenart@bootlin.com>2020-03-19 13:48:19 +0100
committerDavid S. Miller <davem@davemloft.net>2020-03-19 21:02:38 -0700
commit09d65e6d631c052d6b03ef862e93cbb10649df58 (patch)
tree5c6dc3262c652124cd0adc9eba3e92f3c4569c25 /drivers/net/phy/mscc
parent0e1a5773de9e137f9abd14caed95e0aec329d1ec (diff)
net: phy: mscc: add missing check on a phy_write return value
Commit a5afc1678044 ("net: phy: mscc: add support for VSC8584 PHY") introduced a call to 'phy_write' storing its return value to a variable called 'ret'. But 'ret' never was checked for a possible error being returned, and hence was not used at all. Fix this by checking the return value and exiting the function if an error was returned. As this does not fix a known bug, this commit is mostly cosmetic and not sent as a fix. Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/mscc')
-rw-r--r--drivers/net/phy/mscc/mscc_main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/phy/mscc/mscc_main.c b/drivers/net/phy/mscc/mscc_main.c
index 2f6229a70ec1..bc6beec8aff0 100644
--- a/drivers/net/phy/mscc/mscc_main.c
+++ b/drivers/net/phy/mscc/mscc_main.c
@@ -1411,6 +1411,8 @@ static int vsc8584_config_init(struct phy_device *phydev)
val |= (MEDIA_OP_MODE_COPPER << MEDIA_OP_MODE_POS) |
(VSC8584_MAC_IF_SELECTION_SGMII << VSC8584_MAC_IF_SELECTION_POS);
ret = phy_write(phydev, MSCC_PHY_EXT_PHY_CNTL_1, val);
+ if (ret)
+ return ret;
ret = genphy_soft_reset(phydev);
if (ret)