diff options
| author | Tom Rini <[email protected]> | 2017-05-08 22:14:32 -0400 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2017-05-12 08:37:30 -0400 |
| commit | 4201223de8e6bac403213ad57769dfa723db36e3 (patch) | |
| tree | 44ef68f8ab3ccc5d9f9887ada10d9a23fd1c4b04 /drivers | |
| parent | 63c6f1ce3c243695efc1049591198136348ea9b7 (diff) | |
net: phy: mv88e61xx: Fix uninitialized variable warning
The variable 'res' may be unused uninitialized if our call to
mv88e61xx_port_read (register read) fails and we goto the error
handling section. In this case we set 'res' to -EIO to indicate why we
failed.
Cc: Joe Hershberger <[email protected]>
Cc: Chris Packham <[email protected]>
Cc: Kevin Smith <[email protected]>
Cc: Prafulla Wadaskar <[email protected]>
Signed-off-by: Tom Rini <[email protected]>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/net/phy/mv88e61xx.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/phy/mv88e61xx.c b/drivers/net/phy/mv88e61xx.c index a2fd1686fc3..3d2f6b98ad0 100644 --- a/drivers/net/phy/mv88e61xx.c +++ b/drivers/net/phy/mv88e61xx.c @@ -655,8 +655,10 @@ static int mv88e61xx_read_port_config(struct phy_device *phydev, u8 port) do { val = mv88e61xx_port_read(phydev, port, PORT_REG_STATUS); - if (val < 0) + if (val < 0) { + res = -EIO; goto unforce; + } if (val & PORT_REG_STATUS_LINK) break; } while (--timeout); |
