]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: mscc: add missing check on a phy_write return value
authorAntoine Tenart <antoine.tenart@bootlin.com>
Thu, 19 Mar 2020 12:48:19 +0000 (13:48 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 Mar 2020 04:02:38 +0000 (21:02 -0700)
commit6bfdc0b95c0bb1c5d24479b9e710661cd6aae690
tree5c6dc3262c652124cd0adc9eba3e92f3c4569c25
parentec93b46fdee23128e2e00fb449ee0490f6ab53f7
net: phy: mscc: add missing check on a phy_write return value

Commit 20576ec5d86b ("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>
drivers/net/phy/mscc/mscc_main.c