Skip to content

Commit

Permalink
net: phy: initialize rc to zero to avoid returning garbage value
Browse files Browse the repository at this point in the history
In the case where phydev->interrupts is not PHY_INTERRUPT_ENABLED
function vsc85xx_ack_interrupt is returning an uninitialized
garbage value.  Fix this by initializing rc to zero.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Colin Ian King authored and David S. Miller committed Aug 13, 2016
1 parent 1e10f3f commit d16d9d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/phy/mscc.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static int vsc85xx_config_init(struct phy_device *phydev)

static int vsc85xx_ack_interrupt(struct phy_device *phydev)
{
int rc;
int rc = 0;

if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
rc = phy_read(phydev, MII_VSC85XX_INT_STATUS);
Expand Down

0 comments on commit d16d9d2

Please sign in to comment.