aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Simek2018-06-14 09:08:44 +0200
committerJoe Hershberger2018-07-02 14:14:19 -0500
commitd1b226b7d403b29c1064318097d972ce804e96e7 (patch)
treea1cc54cf6bcd98f7e7d7db1abad4c90ad6684e60
parentac378bb05fa3cac3197085431f577e0dbddd4b4a (diff)
net: zynq_gem: Initialize val variable in zynq_gem_miiphy_read()
phyread can timeout and val will contain random value. Initialize it to zero not to report random value in case of error. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
-rw-r--r--drivers/net/zynq_gem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c
index a817f2e5d69..d1138fe0903 100644
--- a/drivers/net/zynq_gem.c
+++ b/drivers/net/zynq_gem.c
@@ -609,7 +609,7 @@ static int zynq_gem_miiphy_read(struct mii_dev *bus, int addr,
{
struct zynq_gem_priv *priv = bus->priv;
int ret;
- u16 val;
+ u16 val = 0;
ret = phyread(priv, addr, reg, &val);
debug("%s 0x%x, 0x%x, 0x%x, 0x%x\n", __func__, addr, reg, val, ret);