Skip to content

Commit 09d65e6

Browse files
atenartdavem330
authored andcommitted
net: phy: mscc: add missing check on a phy_write return value
Commit a5afc16 ("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>
1 parent 0e1a577 commit 09d65e6

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎drivers/net/phy/mscc/mscc_main.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,6 +1411,8 @@ static int vsc8584_config_init(struct phy_device *phydev)
14111411
val |= (MEDIA_OP_MODE_COPPER << MEDIA_OP_MODE_POS) |
14121412
(VSC8584_MAC_IF_SELECTION_SGMII << VSC8584_MAC_IF_SELECTION_POS);
14131413
ret = phy_write(phydev, MSCC_PHY_EXT_PHY_CNTL_1, val);
1414+
if (ret)
1415+
return ret;
14141416

14151417
ret = genphy_soft_reset(phydev);
14161418
if (ret)

0 commit comments

Comments
 (0)