Skip to content

Commit

Permalink
net: zynq_gem: Initialize val variable in zynq_gem_miiphy_read()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Joe Hershberger <[email protected]>
  • Loading branch information
Michal Simek authored and jhershbe committed Jul 2, 2018
1 parent ac378bb commit d1b226b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/zynq_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d1b226b

Please sign in to comment.