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>
lime2-spi
Michal Simek 7 years ago committed by Joe Hershberger
parent ac378bb05f
commit d1b226b7d4
  1. 2
      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);

Loading…
Cancel
Save