Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Gustavo A. R. Silva and committed by
David S. Miller
9fc3e4dc dbc2b5e9

+3
+3
drivers/net/dsa/mv88e6xxx/chip.c
··· 849 849 mv88e6xxx_g1_stats_read(chip, reg, &low); 850 850 if (s->sizeof_stat == 8) 851 851 mv88e6xxx_g1_stats_read(chip, reg + 1, &high); 852 + break; 853 + default: 854 + return UINT64_MAX; 852 855 } 853 856 value = (((u64)high) << 16) | low; 854 857 return value;