* [PATCH] net: phy: initialize rc to zero to avoid returning garbage value
@ 2016-08-12 20:29 Colin King
2016-08-13 22:52 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2016-08-12 20:29 UTC (permalink / raw)
To: Florian Fainelli, Nagaraju Lakkaraju, netdev; +Cc: linux-kernel
From: Colin Ian King <colin.king@canonical.com>
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>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: phy: initialize rc to zero to avoid returning garbage value
2016-08-12 20:29 [PATCH] net: phy: initialize rc to zero to avoid returning garbage value Colin King
@ 2016-08-13 22:52 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-08-13 22:52 UTC (permalink / raw)
To: colin.king; +Cc: f.fainelli, Raju.Lakkaraju, netdev, linux-kernel
From: Colin King <colin.king@canonical.com>
Date: Fri, 12 Aug 2016 21:29:24 +0100
> From: Colin Ian King <colin.king@canonical.com>
>
> 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>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-08-14 9:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-12 20:29 [PATCH] net: phy: initialize rc to zero to avoid returning garbage value Colin King
2016-08-13 22:52 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.