Commit 9fc3e4dc authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by David S. Miller

net: dsa: mv88e6xxx: add default case to switch

Add default case to switch in order to avoid any chance of using an
uninitialized variable _low_, in case s->type does not match any of
the listed case values.

Addresses-Coverity-ID: 1398130
Suggested-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarGustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dbc2b5e9
...@@ -849,6 +849,9 @@ static uint64_t _mv88e6xxx_get_ethtool_stat(struct mv88e6xxx_chip *chip, ...@@ -849,6 +849,9 @@ static uint64_t _mv88e6xxx_get_ethtool_stat(struct mv88e6xxx_chip *chip,
mv88e6xxx_g1_stats_read(chip, reg, &low); mv88e6xxx_g1_stats_read(chip, reg, &low);
if (s->sizeof_stat == 8) if (s->sizeof_stat == 8)
mv88e6xxx_g1_stats_read(chip, reg + 1, &high); mv88e6xxx_g1_stats_read(chip, reg + 1, &high);
break;
default:
return UINT64_MAX;
} }
value = (((u64)high) << 16) | low; value = (((u64)high) << 16) | low;
return value; return value;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment