[PATCH] net: phy: initialize rc to zero to avoid returning garbage value

Subsystems: ethernet phy library, networking drivers, the rest

STALE3654d

2 messages, 2 authors, 2016-08-14 · open the first message on its own page

[PATCH] net: phy: initialize rc to zero to avoid returning garbage value

From: Colin King <hidden>
Date: 2016-08-12 20:30:29

From: Colin Ian King <redacted>

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 <redacted>
---
 drivers/net/phy/mscc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/phy/mscc.c b/drivers/net/phy/mscc.c
index 2e1de53..ad33390 100644
--- a/drivers/net/phy/mscc.c
+++ b/drivers/net/phy/mscc.c
@@ -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);
-- 
2.8.1

Re: [PATCH] net: phy: initialize rc to zero to avoid returning garbage value

From: David Miller <davem@davemloft.net>
Date: 2016-08-14 09:28:28

From: Colin King <redacted>
Date: Fri, 12 Aug 2016 21:29:24 +0100
From: Colin Ian King <redacted>

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 <redacted>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help